Share your repls and programming experiences

← Back to all posts
How do i make this work?!?
StevenThomas1 (0)

def main():
getinput(X, Y)
processing(Z)
output(Z)
X = miles_driven
Y = gallons_used
Z = mpg

def getinput(X, Y):
#using input to get data from user
X = float(input("Enter miles driven:"))
Y = float(input("Enter gallons used:"))
return X / Y

def processing(Z):
return Z = X / Y

def output(Z):
print("Miles per gallon:", Z)

main()

Commentshotnewtop
AdCharity (157)

Well you aren't asking for user input... shouldn't there be like X = input('Enter number of miles driven: ') to get user input with python?