Question: Understand the code Answer the question: What if we use ' or ' instead of 'and' in the while loop? Modify the code Use while

Understand the code
Answer the question:
What if we use 'or' instead of 'and' in the while loop?
Modify the code
Use while loops for all selections to make sure the user input is valid.
You find four chests in the house.
The new chest is yellow.
The new chest contains a pair of running shoes.
When you select 'run', you can run faster than the orc and survive if you have a pair of running shoes.
Create a new variable strength. The initial value of strength is 0.
When you pick up the sword, the value of strength increases by 8.
When you pick up the sticks, ask user to select how many sticks they want to pick up. The number of sticks is between 0 and 5. Please make sure the user input is valid. Each stick increases the value of strength by 1.
You can only kill the orc if the strength value exceeds 4.
You can submit a py file or use the "Text Submission"
Highlight the changes

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 Programming Questions!