python - Parse String to Float or Int - Stack Overflow

python - Parse String to Float or Int - Stack Overflow

瀏覽:875
日期:2024-05-03
In Python, how can I parse a numeric string like "545.2222" to its corresponding float value, 542.2222? Or parse the string "31" to an integer, 31? I just want to know how to parse a float string to a float, and (separately) an int string to an int....看更多