Question
Why wont my code say Your ordered whatever their order was for a price. All it says is the number which I know that, but
Why wont my code say "Your ordered whatever their order was for a price." All it says is the number which I know that, but I'm just trying to figure out what's wrong with my code.
number = int(input("How many orders are being placed? "))
while number <= 1 or number >=25:
print("Invalid Input")
number = int(input("Can only order between 1 and 25 orders. Enter an order between 1 and 25. "))
menu_items = [
[1, "Buffalo Nuggets Single", 3.50], [2, "Buffalo Nuggets Meal", 5.00],
[3, "Permesan Nuggets", 3.25], [4, "Permesan Nuggets Meal", 4.75],
[5, "Barbeque Nuggets", 3.00], [6, "Barbeque Nuggets Meal", 4.50],
[7, "Chillie Cheese Nuggets", 1.25], [8, "Chilli Cheese Nuggets Meal", 6.00]
]
print("Menu")
for item in menu_items:
print('{} {} - {:.2f}'.format(*item))
order = [] # initilize your list
for i in range(number): # will itterate that many times
menu_number = int(input(' Please enter the number of an item you would like: '))
while menu_number < 1 or menu_number > 8:
print("Invalid Input")
menu_number = int(input("Can only order between 1 and 8. Enter a menu item between 1 and 8. "))
order.insert(i, menu_number)
order_total = 0
print("You ordered", menu_number "for" order_total)
order_total = 0
for j in range(len(order)): # loop for each order
order_total += menu_items[j][2]
order.insert(j, menu_items[j][1])
print("You ordered:", end=' ')
for k in range(len(order)):
if k == len(order):
print(order[k])
else:
print(order[k], end=", ")
print("Your order total was:", order_total)
]
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started