Aug-30-2018, 05:03 PM
Okay, then how about:
choice = input('Choose an item to view the details of: ').lower() for item in self.inventory: if choice == item.name: item.getdetails()It would be more efficient if you stored it as a dictionary rather than a list. Then you wouldn't need the loop. Also, your use of raw_input makes me think you are using Python 2.x. You should switch to Python 3.x.
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