Hello people,how do you round off numbers in python?( e.g to the nearest whole number 66.6 to 67 and 66.1 to 66) | Sololearn: Learn to code for FREE!
¡Nuevo curso! ¡Todo programador debería aprender IA Generativa!
Prueba una lección gratuita
+ 8

Hello people,how do you round off numbers in python?( e.g to the nearest whole number 66.6 to 67 and 66.1 to 66)

27th Oct 2020, 7:09 AM
Angry Student(Docvad)
Angry Student(Docvad) - avatar
2 Respuestas
+ 2
Let me attempt it. I had used int (66.6 ) but it gave me 66 as an answer.
27th Oct 2020, 7:42 AM
Angry Student(Docvad)
Angry Student(Docvad) - avatar
+ 1
Round off fuctions round() math.ceil() math.floor() To use math.ceil and math.floor, you must first put the code ( import math) on its on line.
4th Nov 2020, 10:42 AM
NIGHT LIGHT