Python – How to convert String to float
In Python, we can use float() to convert String to float. num = "3.1415" print(num) print(type(num)) # str pi = float(num) # convert str to float print(pi) print(type(pi)) # float Output 3.1415 <class ‘str’> 3.1415 <class ‘float’> References Python docs – float()