Help with my text adventure game!!! | Sololearn: Learn to code for FREE!

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?

11/7/2017 5:11:15 PM

Hyrum Harris

1 Answer

New Answer

+1

nested if else statement, i think.