+ 2

Halloween Candy Code Coach Problem

I tried doing this earlier with the int() function but did not work well. So went online and found out about round(). It works in rounding but i still get only 2 out of 5 tests and the other ones i can't see. The explanations online do not really explain how to round to whole numbers, mostly significant figures. houses = int(input()) #your code goes here dollar_houses= 2 dollar_bills = round((dollar_houses/houses) * 100) if houses >= 3: print(int(dollar_bills)) else: print("put a higher number") Can someone please tell me what is wrong here or a better way to round the numbers? Thank you.

25th Dec 2019, 5:34 PM
Chidera Nwosu
Chidera Nwosu - avatar
4 odpowiedzi
+ 2
Thank you.
25th Dec 2019, 5:59 PM
Chidera Nwosu
Chidera Nwosu - avatar
+ 2
Alexandr thank you!
25th Dec 2019, 6:39 PM
Chidera Nwosu
Chidera Nwosu - avatar
+ 2
Thanks Coder. Got the answer already
27th Dec 2019, 1:03 PM
Chidera Nwosu
Chidera Nwosu - avatar
+ 1
So i read the python doc and found the solution. Was missing an import math and ceil function
25th Dec 2019, 6:00 PM
Chidera Nwosu
Chidera Nwosu - avatar