float function | Sololearn: Learn to code for FREE!
Nouvelle formation ! Tous les codeurs devraient apprendre l'IA générative !
Essayez une leçon gratuite
+ 2

float function

Does the float function have the same role as the int function ( by converting key presses into numbers) but with decimal?

13th Feb 2018, 10:25 PM
2 Réponses
+ 5
Yes, float("5.4") works like int("5"). However, both can also convert numbers so float(5) or int(5.2) is fine.
14th Feb 2018, 12:20 AM
John Wells
John Wells - avatar
+ 2
Thank you for your answer.
24th Feb 2018, 11:07 PM