I am trying to understand why the output print(idx,item) is not given back on the shell, when I run this program in a python module.
def price_of_items():
items=["pear","apple","grape"]
prices_items=[]
for i in items:
price=int(input("Please enter the price of",+item))
price_items.append(price)
for idx, item in enumerate(price_items):
print(idx,item)
return
def main():
option=""
while option not in "X": #Loop control for when user doesnt exit program
print("Main Menu")
print()
print("A/ItemPricing")
print("X. Exit")
option=input("Please select an option A or X from the Menus above")
option=option.upper()
while option not in ("A","X"):
print("Invalid Input")
option=input("Select either from A or from X")
option-option.upper()
if option=="A":
price_of_items()
else:
exit()
main()
while option != 'X'because if you check if an empty string is in another string, well, then it will be there because it doesn't take up any spacewhile option not in "X"is wrong, you never go into the loop. Usewhile option != "X"