Ask coding questions

← Back to all posts
how to make it a whole number.
eamonwong4

hey everyone, i was just coding and my code prints out a decimal instead of a whole number (line 38, student.py), how do you make it a whole number and print out months as well instead of just a decimal years?

thanks.

@eamonwong4

Answered by MrVoo [earned 5 cycles]
View Answer
Voters
eamonwong4
Comments
hotnewtop
MrVoo

Division always returns a float, use int() if you want it to be an integer (it rounds down)

Stonkic

I believe the solution to your decimal problem would be using the round() function.