0
Halloween candy last three
I get the first two, but not the last three. I saw in the discussion to use a function I haven't covered yet. I want to use what I have covered. This is my code: houses = int(input()) if houses >=3: prob = (2/houses) pct = (prob * 100) i = pct y = round(i,1) z = round(y) print (z) What am I missing?
2 odpowiedzi
+ 1
During solving that coach I remember having some problems with rounding.
0
houses = int(input())
#your code goes here
dollar = 2
percentage = (dollar * 100) //houses
percent = (dollar * 100) /houses
if percentage < percent :
percentage +=1
print (percentage )