170k views
22 votes
How to get the whole number of a fraction in python

User Iboboboru
by
6.3k points

1 Answer

11 votes

Answer:

Using the modulo ( % ) operator. The % operator is an arithmetic operator that calculates and returns the remainder after the division of two numbers. If a number is divided by 1, the remainder will be the fractional part.

User Robert Kearns
by
6.3k points