0
int(), float() and str() in python?
Why does this statement produce an error: print (int('70.0'))
3 Respuestas
+ 3
ᎪᏞᎪ'Ꭺ ᎪᏞᎠᎬᎬΝ ՏᎻᎪᎷᎷᎡ Actually int() function expects an integer string or a float, but not a float string. If a float string is given, you need to convert it to float first then to int as:
int(float(userGuess))
Inherited from: https://stackoverflow.com/questions/27048627/how-to-convert-a-float-string-to-an-integer-in-JUMP_LINK__&&__python__&&__JUMP_LINK-3
+ 1
Because you missed the last closing parentheses of print()
+ 1
Genuine Stalwart
Ok
Try it now