How to round up in Python | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2

How to round up in Python

Pls assist

9th Jul 2020, 2:24 PM
Segun Mikael
Segun Mikael - avatar
3 Answers
+ 2
Lothar You are right, the linked code is wrong. This search result is better https://code.sololearn.com/cEho42jhEsTk/?ref=app
9th Jul 2020, 6:24 PM
Gordon
Gordon - avatar
+ 5
Gordon , in the code from kuvam: if one > 0.5: print(int(num) + 1) means that 2.5 is rounded down -> 2, and that 2.51 is rounded up -> 3 ??? I thought that 2.5 should give 3.
9th Jul 2020, 6:00 PM
Lothar
Lothar - avatar
+ 3
Our code playground has a filter option and a search feature. Try searching "roundup" and filter option "Python" You should get this search result : https://code.sololearn.com/c6G6Knuq7wmN/?ref=app
9th Jul 2020, 2:28 PM
Gordon
Gordon - avatar