Halloween Candy Challenge final 3
I am having issues with the final 3 that it won’t show you the numbers for. My code works perfectly and rounds to the nearest whole number. That’s why I don’t understand why it isn’t working. #input will be an int (>=3) houses = int(input()) #get the float chance to pull a dollar chance = (2 / houses) * 100 decimal = chance #gets only the numbers after the decimal place while decimal >= 1: decimal -=1 #adds one to chance only if 0.5 or greater if decimal >= 0.5: chance += 1 #print the chance(ex. 3.9 will print 3, so will 3.49) print(int(chance)) I’ve seen people using the math import and ceil, but i did the same concept and it didn’t work for the challenge. I’m confused because I tried to make mine as basic as possible. Is there something else the ceil does that I don’t know about?