Nov-13-2019, 12:30 AM
Hi, why is my code; "str(input('Enter a plan: ; plan)) giving me a syntax error? I thought this syntax is perfectly legal in Python.
plan = 'M' # ‘M’ = monthly, ‘D’ = daily plan = 'D' xplan = str(input('Enter plan: ' plan)) hours = 4 student = False senior = False total = 0 # write the code to calculate the total below if xplan == 'M': basefee = 30 discount = 10/100 hourlyfee = 3 basehour = 30 extrahours = hours - basehour extrafee = extrahours*hourlyfee totalfee = basefee + extrafee if student == True and hours > 30: discountedcost = (totalfee)*discount totalcost = totalfee - discountedcost print(totalcost) elif hours < 30: totalfee = totalfee - extrafee print(totalfee) elif xplan == 'D': if hours < 4 and student == False and senior == False: totalfee = 10* hours print(totalfee) elif hours > 4 and student == True and senior == True: totalfee = (8*hours)*0.10 print(totalfee)