python - How do I parse a string to a float or int? - Stack Overflow
https://stackoverflow.com/questions/379906/how-do-i-parse-a-string-to-a-float-or-int
Dec 19, 2008 · As a general rule, if you have an object in Python, and want to convert to that type of object, call type(my_object) on it. The result can usually be called as a function to do the conversion. For instance type(100) results in int, so you can call int(my_object) to try convert my_object to an integer. This doesn't always work, but is a good ...
DA: 92 PA: 87 MOZ Rank: 100