Python How to convert float to String
摘要: In Python, we can use str() to convert float to String.
In Python, we can use str() to convert float to String.
pi = 3.1415 print(type(pi)) # float piInString = str(pi) # float -> str print(type(piInString)) # str
Output
<class 'float'> <class 'str'>
References