1

I was writing a Python 3.5.2 program which includes division.

When I ran the following:

>>> 10/2
5.0

Though the answer is correct, it has a decimal point. What should be done to get quotient without decimal point, for example, 10/2 should yield 5, not 5.0?

jonrsharpe
  • 107,083
  • 22
  • 201
  • 376
Steffi Keran Rani J
  • 3,051
  • 3
  • 25
  • 47

1 Answers1

0

Check out this answer. In Python 3 Integer division is performed using the // operator, and the regular division operator can yield float. Check 1/2 for example - if you get 0.5, that's not Integer division, 0 is. IDLE is irrelevant here.

Steffi Keran Rani J
  • 3,051
  • 3
  • 25
  • 47
kabanus
  • 22,925
  • 6
  • 32
  • 68