Pls, how do you approximate using numbers | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Pls, how do you approximate using numbers

66.66667 to 67

2nd Nov 2023, 7:52 PM
Abdulazeez
Abdulazeez - avatar
11 Answers
+ 9
Abdulazeez , your code uses int() to do the rounding. this is *rounding down*. we have to *round up* (see the task description!). > there is a function in math module that can achieve this: ceil()
2nd Nov 2023, 8:23 PM
Lothar
Lothar - avatar
+ 7
Have a close look at the output format: You are supposed to round ***up*** to the nearest whole number.
2nd Nov 2023, 8:20 PM
Lisa
Lisa - avatar
+ 6
Abdulazeez , sorry, my post is not explicitly saying that we have to *import* the ceil() function. put this line at the top of your code: from math import ceil ...
3rd Nov 2023, 1:39 PM
Lothar
Lothar - avatar
+ 5
It is called rounding. If you need help with your code, link your code and describe what it is supposed to do
2nd Nov 2023, 8:04 PM
Lisa
Lisa - avatar
+ 4
you need to import the function from the math module
3rd Nov 2023, 8:08 AM
Lisa
Lisa - avatar
2nd Nov 2023, 8:11 PM
Abdulazeez
Abdulazeez - avatar
+ 2
https://code.sololearn.com/cI34M6ymKLLv/?ref=app
3rd Nov 2023, 7:13 AM
Abdulazeez
Abdulazeez - avatar
+ 2
Use ciel() for +roundup and for -roundup use floor() eg. ciel() = 6.6666 = 7 floor() = 6.6666 = 6
3rd Nov 2023, 12:34 PM
Alhaaz
Alhaaz - avatar
+ 2
To approximate 66.66667 to the nearest whole number, you can round it. In this case, 66.66667 is closest to 67. So, you can say that 66.66667 is approximately equal to 67.
3rd Nov 2023, 1:15 PM
রহস্যময়— পৃথিবী
রহস্যময়— পৃথিবী - avatar
+ 2
Thanks
6th Nov 2023, 6:06 PM
Abdulazeez
Abdulazeez - avatar
0
The ceil() Function is not working
3rd Nov 2023, 7:11 AM
Abdulazeez
Abdulazeez - avatar