Oct-09-2017, 01:56 AM
Hello so in my program when I try to run it, it comes up with Syntax error then highlights my def statement (To help explain I underlined the part that is highlighted). I do not know why this is happening but I have tried retyping it with no success. How can I fix this error? If you want to know what it does then here it is: Pass_Cost() allows the user to pick their package and discount given from Pass_Package() and Pass_Discount(). If the user does not put in 7, 14 or 30 then the user is prompted to answer it correctly. Again the main problem is the Syntax error in def statement of Pass_Cost().
def Pass_Show():
print("Aussie Pass!")
print("Please select a package and discount depending on age.")
print("E.g. Package = 7")
Pass_Package()
def Pass_Package():
print("7 Day Pass – $139.95")
print("14 Day Pass - $239.95")
print("30 Day Pass - $500.00")
Pass_Discount()
def Pass_Discount():
print("Children (Under 15) - 60% off")
print("Students (Over 15 & less than 22) - 40% off")
print("Seniors (60 or over) - 50% off")
Pass_Cost()
def Pass_Total():
cost = Pass_Cost()
total = Pass_Calculate(cost)
print("The total cost is: $" + str(total)
def Pass_Cost():#User inputs the type of package they suit and discount
cost=list()
package = input("Package: ")
if package == "7" or "14" or "30": #If they enter those values they will move onto choosing their discount
print("Proceed...")
cost.append(package)
if package != "7" or "14" or "30":
Pass_Cost()#If they do not enter any of those values they will be prompted to ask again
discount = input("Discount: ")
if discount == "Children":
discount == 0.60
cost.append(discount)
if discount == "Students":
discount == 0.50
cost.append(discount)
if discount == "Seniors":
discount == 0.40
cost.append(discount)
if discount != "Children" or "Students" or "Seniors":
return discount
def Pass_Calculate(cost):
return cost[0] * cost[1] #Calculates the cost from their chosen package and discount e.g. 7 * 0.6
#7 being the chosen package (7 Day Pass) and 0.6 being Children discount
Pass_Show()
def Pass_Show():
print("Aussie Pass!")
print("Please select a package and discount depending on age.")
print("E.g. Package = 7")
Pass_Package()
def Pass_Package():
print("7 Day Pass – $139.95")
print("14 Day Pass - $239.95")
print("30 Day Pass - $500.00")
Pass_Discount()
def Pass_Discount():
print("Children (Under 15) - 60% off")
print("Students (Over 15 & less than 22) - 40% off")
print("Seniors (60 or over) - 50% off")
Pass_Cost()
def Pass_Total():
cost = Pass_Cost()
total = Pass_Calculate(cost)
print("The total cost is: $" + str(total)
def Pass_Cost():#User inputs the type of package they suit and discount
cost=list()
package = input("Package: ")
if package == "7" or "14" or "30": #If they enter those values they will move onto choosing their discount
print("Proceed...")
cost.append(package)
if package != "7" or "14" or "30":
Pass_Cost()#If they do not enter any of those values they will be prompted to ask again
discount = input("Discount: ")
if discount == "Children":
discount == 0.60
cost.append(discount)
if discount == "Students":
discount == 0.50
cost.append(discount)
if discount == "Seniors":
discount == 0.40
cost.append(discount)
if discount != "Children" or "Students" or "Seniors":
return discount
def Pass_Calculate(cost):
return cost[0] * cost[1] #Calculates the cost from their chosen package and discount e.g. 7 * 0.6
#7 being the chosen package (7 Day Pass) and 0.6 being Children discount
Pass_Show()