Python – How 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'>
No, it’s not working
Have you checked out python convert int to string
eric
c’est une mauvaise technique de faire nombre = str(nombre)
# variable expr1 and its value
expr1 = 1700/19
print(“The value of expr1:”, expr1)
# variable expr2
expr2 = _1700/19_
print(“The value of converted into string expr2:”, _ _ _)