Looking help with the code below, it seems that adding m_Time on the first if statement makes the program run incorrectly. Just looking at the first if statement, the rest works as intended. Any help regarding this would be appreciated.
tick_Num = float(input("How many tickets are you buying? "))
day = input("What day do you want to watch the movie? Enter mon for Monday etc. ")
m_Time = int(input("What time is the movie? Enter 0000 to 2359: "))
if 200 <= m_Time <= 1600 and tick_Type == "child" and day != "sat" or day != "sun":
print("You should be in school, not at the movies.")
elif tick_Type == "child" and day == "mon" or day == "tue" or day == "wed":
total = 8 * tick_Num * 0.75
print("Total: $" + format(total,",.2f"))
elif tick_Type == "senior" and day == "mon" or day == "tue" or day == "wed":
total = 9 * tick_Num * 0.75
print("Total: $" + format(total,",.2f"))
elif tick_Type == "general" and day == "mon" or day == "tue" or day == "wed":
total = 10 * tick_Num * 0.75
print("Total: $" + format(total,",.2f"))
elif tick_Type == "child" and day == "thu" or day == "fri" or day == "sat":
total = 8 * tick_Num * 1
print("Total: $" + format(total,",.2f"))
elif tick_Type == "senior" and day == "thu" or day == "fri" or day == "sat":
total = 9 * tick_Num * 1
print("Total: $" + format(total,",.2f"))
elif tick_Type == "general" and day == "thu" or day == "fri" or day == "sat":
total = 10 * tick_Num * 1
print("Total: $" + format(total,",.2f"))
elif tick_Type == "child" and day == "sun":
total = 8 * tick_Num * 0.9
print("Total: $" + format(total,",.2f"))
elif tick_Type == "senior" and day == "sun":
total = 9 * tick_Num * 0.9
print("Total: $" + format(total,",.2f"))
elif tick_Type == "general" and day == "sun":
total = 10 * tick_Num * 0.9
print("Total: $" + format(total,",.2f"))
elif day == "mon" or day =="tus" or day == "wed":
total = 10 * tick_Num * 0.75
print("Total: $" + format(total,",.2f"))
elif day == "thu" or day =="fri" or day == "sat":
total = 10 * tick_Num * 1
print("Total: $" + format(total,",.2f"))
elif day == "sun":
total = 10 * tick_Num * 0.9
print("Total: $" + format(total,",.2f"))
else:
print("NO TICKET: invalid day")
eliffor every possible combination of conditions. You should create dictionaries like{'child': 8, 'senior': 9, 'general': 10}and get the factors for the price from there.