Python Forum

Full Version: Need Help
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Need help with the code
def main():
miles=0;class_type=""
#class_type is a string literal so it should=""open quotes and not()
miles=getInput(miles)
miles,class_type=processing(miles,class_type)
dispaly(clas_type)

def getInput(miles):
miles=int(input("Enter the number of miles flown:"))
return miles
def processing(miles,class_type):
if miles>100000:
class_type="Class A"
elif miles>50000:
class_type="Class B"
elif miles>10000:
class_type="Class C"
else:
class_type="Class Z"
return miles,class_type

#Python finds a match and stops. The program would not work correctly if the numbers
#are put in reverse order
def display(class_type):
print("This passenger is a" ,class_type,"passenger")
main()