0
what's wrong in my code? please help. halloween candy
https://www.sololearn.com/coach/4?ref=app what's wrong in my code? the last three test cases are locked and showing that my code had failed but the unlocked two show that my code had passed those those test cases. https://code.sololearn.com/cmhfgww9Il78/?ref=app
3 Answers
+ 13
import math
houses = int(input())
if houses >= 3:
print(math.ceil((2/houses)*100))
https://www.sololearn.com/Discuss/2751150/?ref=app
+ 5
Abdus Sattar
What if houses is less than 3? You didn't print anything in this case.
Use ceil instead of round and also do not check condition just do this:
import math
houses = int(input())
#if houses >= 3:
print(math.ceil((2 / houses) * 100))
+ 1
thanks Simba I didn't realize round UP means literally rounding UP until today. thanks again.