0

I am trying to make a combo menu program for a project. In the program I need to set variable is_combo to True if the order is a combo. It is a combo if a meat, drink, and fries are selected in the customer_order variable. This is my code but it doesn't work as expected. It always results in "True" for is_combo even if it isn't a combo. How can I fix it to make it work as intended?

Code Not Working

if "chicken" or "beef" or "tofu" in customer_order and "small drink" or "medium drink" or "large drink" in customer_order and "small fry" or "medium fry" or "large fry" in customer_order:
    is_combo = True
    print(is_combo)

Full Program

# START CONFIG
menu = {
    "chicken": 5.25,
    "beef": 6.25,
    "tofu": 5.75,
    "small drink": 1.00,
    "medium drink": 1.50,
    "large drink": 2.25,
    "small fry": 1.00,
    "medium fry": 1.50,
    "large fry": 2 }
combo_discount = 1
customer_order = []
total_cost = 0
is_combo = False
# END CONFIG

print(menu)
while True:
    x = input("Enter menu item or press enter to continue: ")
    if x == "":
        print(customer_order)
        break
    while x not in (menu):
        x = input("\x1b[30;41m[!]\x1b[0mEnter menu item or press enter to continue: ")
    customer_order.append(x)
    print(customer_order)
for x in customer_order:
    total_cost = total_cost + menu[x]

# KETCHUP
ketchup_number = input("How many ketchup packets?: ")
ketchup_number = abs(int(ketchup_number))
total_cost = total_cost + (0.25 * ketchup_number)

print("$" + str(total_cost))

# COMBO DISCOUNT
if "chicken" or "beef" or "tofu" in customer_order and "small drink" or "medium drink" or "large drink" in customer_order and "small fry" or "medium fry" or "large fry" in customer_order:
    is_combo = True
    print(is_combo)
diamondpy
  • 23
  • 5

0 Answers0