I just started learning python 2 days ago and Im trying to make some kind of text based adventure to practice , the only problem Im having is with functions:
def menu_op():
print('1- Action 1')
print('2- Action 2')
choice= input('Choose action: ')
return choice
def action_op(x):
if x == 1:
print('You chose action 1')
if x == 2:
print('You chose action 2')
menu_op()
action_op(menu_op())
The idea behind this is to call the menu function , which gives a value equal to user's input , which gets fed into the action function when the latter is called and does something depending on the user choice.
Cant tell what im doing wrong though , as the code doesnt seem to work. Thanks in advance
menu_optwice?