I have created a small program to practice what I learned in python.
for example, I have prices in a list, so I calculated the total by indexing the list. I’m not able to store it in a variable.
Are there any possible ways we could store it in a variable?
food_name = [ Chicken sandwich, bun, beef fry, Chicken balls]
for food_display in [’ Chicken sandwich 10$ (A) , bun 2$ (B), beef fry 12$ ©, Chicken balls 5$ (D)’]:
print(food_display)
Food_price = [10, 2, 12, 5]
order_entry = input("").upper()
Number_of_quantity = intinput(""))
if order_entry = ‘A’:
print(“Ordered:{}”.format({food_name[0]}), “Total:”, price[0] * food_quantity )
This is a similar example of my program.
Now how do I assign “price[0] * food_quantity” to a variable?
Any Volunteer would like to offer me a solution to this problem.
Your support would be highly appreciated!
Thank you!