New course! Every coder should learn Generative AI!
Try a free lesson0
Python Beginner Help
""" Given the input of the total number of houses that you visited, what is the percentage chance that one random item pulled from your bag is a dollar bill? """ houses = int(input()) #your code goes here x = houses/2 y= (((houses/x))/houses)*100 v =round(y) print(v) """ Runs corrctly. However, i feel there can be more to it. PS. i'm just a beginner. """
4 Answers
+ 3
import math
houses = int(input())
a=(2/houses)*100
print(math.ceil(a))
This one too works...try this too
+ 1
Emerson Prado typing mistake...
0
Djwerter Richmond What's the logic behind the calculations? You seem to output round(200/houses), but with lots of extra steps. Why?
0
Arun Venkatesh.N In fact, your code has a syntax error: wrong indentation in line 3