0
Help with my text adventure game!!!
I need help with the user choosing something from the lists. items = {'item1': 'bill', 'item2': 'cows', 'item3': 'pig'} bill = {'choice': 'Be in debt', 'choice2': 'be rich'} cows = {'choice': 'have beef', 'choice2': 'be fat'} pig = {'choice': 'have pork', 'choice2': 'be really fat'} print(items) choice = input("Select your item: ") if choice in items: the_choice = items[choice] else: print("Uh oh, I don't know about that item") print(choice + ' ok lets do this') print('you are going to pick the next choice from the list') if choice == 'item1': print(bill) If the user inputs 'item2' then it will print the list for cows. What do i use? If else or what?
1 Answer
+ 1
nested if else statement, i think.