+ 2
Halloween Candy Code Coach Problem
I tried doing this earlier with the int() function but did not work well. So went online and found out about round(). It works in rounding but i still get only 2 out of 5 tests and the other ones i can't see. The explanations online do not really explain how to round to whole numbers, mostly significant figures. houses = int(input()) #your code goes here dollar_houses= 2 dollar_bills = round((dollar_houses/houses) * 100) if houses >= 3: print(int(dollar_bills)) else: print("put a higher number") Can someone please tell me what is wrong here or a better way to round the numbers? Thank you.
4 Réponses