[Solved] How to print the input string as a float (1 into 1.0) python


Try

print('{} rods.'.format(num_rods))

or

print('rods: ',num_rods)

Also, be careful with statements of this type. Check what happens to the code if, instead of inputting an int or float, you pass the character ‘a’ for example.

2

solved How to print the input string as a float (1 into 1.0) python