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?