Getting a nearest whole no. in python | Sololearn: Learn to code for FREE!
¡Nuevo curso! ¡Todo programador debería aprender IA Generativa!
Prueba una lección gratuita
+ 1

Getting a nearest whole no. in python

if input is a no. how can I get an output of its nearest whole no.

18th Dec 2019, 3:20 PM
Rishav Kumar
Rishav Kumar - avatar
1 Respuesta
+ 2
With the function round. You just have to convert the input to a float, then round it.
18th Dec 2019, 3:57 PM
HonFu
HonFu - avatar