0

Code Coach: Halloween candy

My code passes the first 2 tests but fails the next 3. These tests are locked so I can’t see what’s happening but I believe my result is out by 1 I would really appreciate any help in understanding why my result isn’t consistent. houses = int(input()) #your code goes here percentage = (2 / houses) * 100 print(round(percentage))

6th Mar 2023, 1:10 AM
Tom
Tom - avatar
1 Antwort
+ 6
# Use math.ceil instead of round import math houses = int(input()) percentage = (2 / houses) * 100 print(math.ceil(percentage ))
6th Mar 2023, 2:48 AM
SoloProg
SoloProg - avatar