The user has to choose between the regular menu and the veggie menu.
However, I have difficulties calling them in the main() function. Here is what I already have:
def displayMenu():
print ("1. regular menu\n 2. veggie menu")
user_choice = input("Which one do you want to choose? (1 or 2)")
return user_choice
def regularMenu(rmenu):
rmenu = open("regularmenu.txt","r")
for line in rmenu:
line.strip ()
print(line)
def veggieMenu(vmenu):
vmenu = open("veggiemenu.txt","r")
for line in vmenu:
line.strip ()
print(line)
def main(): # Here is where I have difficulty
# If the user chooses 1, print regular menu
# If the user chooses 2, print veggie menu
# I don't know how to make the if statement here
'move'and'jump'with'1'and'2'.displayMenu()function returns the user choice, so why can you not operate on the return value in yourmain()?main()will itself need to be called at some point as Python does not follow the same behavior as C/C++/Java in having a function that's called automatically at program start.