Aug-30-2018, 01:42 PM
So, inventory is just a list of items? Then loop through them and print them out with a number, and have the user input a number to get the item:
for item_index, item in enumerate(inventory): print('{}: {}'.format(item_index, item)) print() choice = int(input('Which item would you like to view? ')) chosen_item = inventory[choice]Enumerate returns tuples of the index of an item and the item itself. You might want bells and whistles for this, like handling non-integer input or integers that aren't valid indexes for inventory.
Craig "Ichabod" O'Brien - xenomind.com
I wish you happiness.
Recommended Tutorials: BBCode, functions, classes, text adventures
I wish you happiness.
Recommended Tutorials: BBCode, functions, classes, text adventures