I am new to programming and I have been running into various problems for a while now. This is a simple code where I want to be able to select an item from the store "Walmart" and based on that, access the number from walmart_prices
and print that number. So, if someone selects "3", it should display the corresponding number in walmart_prices
.
Here is an extremely simple code:
walmart_prices = ["10", "15", "20", "20", "25", "10", "12", "18", "12", "22"]
store = input("Walmart, Costco, or Sprouts?").lower()
if store == ("walmart"):
w = input("1 - $10, 2 - $15, 3 - $20, 4 - $20, 5 - $25, 6 - $10, 7 - $12, 8 - $18, 9 - $12, or 10 - $22")
print("Here are your items:", w)
print("Your total is: $", walmart_prices[store])