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))
1 Respuesta
+ 6
# Use math.ceil instead of round
import math
houses = int(input())
percentage = (2 / houses) * 100
print(math.ceil(percentage ))