Question: Python Code Specifications Your instructor should provide a text file named wizard_all_items.txt that contains a list of all the items that a wizard can carry.

Python Code

Specifications

Your instructor should provide a text file named wizard_all_items.txt that contains a list of all the items that a wizard can carry.

This is the text file provided (list of items user can interact with):

a wooden staff a wizard hat a cloak of invisibility some elven bread an unknown potion a scroll of uncursing a scroll of invisibility a crossbow a wizard's cloak

When the user selects the walk command, the program should read the items from the file, randomly pick one, and give the user the option to grab it.

Your program should create another file that stores the items that the wizard is carrying. Make sure to update this file every time the user grabs or drops an item.

The wizard can only carry four items at a time.

For the drop command, display an error message if the user enters an invalid number

for the item.

This should be the outcome:

console:

The Wizard Inventory program 
COMMAND MENU walk - Walk down the path show - Show all items drop - Drop an item exit - Exit program 
Command: walk  While walking down a path, you see a scroll of uncursing.  Do you want to grab it? (y/n): y. You picked up a scroll of uncursing.  
Command: walk While walking down a path, you see an unknown potion. Do you want to grab it? (y/n): y You can't carry any more items. Drop something first. 
Command: show 1. a wooden staff 2. a scroll of invisibility 3. a crossbow 4. a scroll of uncursing 
Command: drop Number: 3 You dropped a crossbow. 
Command: exit Bye!

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!