Skip to content
← Back to Community
input a whole number, output a decimal number
Profile icon
bjwry12345

If the user inputs a value without decimal (example: 32, 12, 99,100), is there a way for the output to come out with a decimal point + 0?

ex:
input 32
Output 32.0

input 12
Output12.0

Answered by abc3354 [earned 5 cycles]
View Answer
Voters
Profile icon
bjwry12345
Comments
hotnewtop
Profile icon
abc3354

Hi :)

You can use float()

Example [try it here] :

i = input() f = float(i) print(f)

Replit helper here !
If you found my answer helpful, you can upvote it :)