asked 220k views
5 votes
How do I add decimals in python?

asked
User Ramanr
by
8.5k points

1 Answer

5 votes

x = 0.6

y = 0.4

print(x + y)

This will output 1.0 to the console.

You could also just do:

print(0.6+0.4)

This will yield the same result.

answered
User Ehsan Jeihani
by
8.5k points

No related questions found