subject

Now, it’s time for you to begin coding your text-based adventure game! Starting at the top, convert each line of your pseudocode from your Coding Log into a line of Python code.
Make sure to use the correct syntax and indentation. If you decide to challenge yourself and use functions, be sure to include the correct function calls.
Your code should include at least two loops—one while loop and one for loop.
Run and test your code in parts as you go. Follow the iterative process of coding and revising. It may be helpful to apply this process to each part of your game (Intro, Part 1, Part 2, and Part 3).
Make the following improvements to your game:
If the user types in a slightly different word than you expect, you don’t want your game to crash! Use lists to gain a better understanding of the input that users give. Refer back to Unit 1 for more information on lists. Here is an example:
if choice in [“set a trap”, “set trap”, “trap”, “make a trap”, “make trap”]
Your list won’t work if the user capitalizes any letter because the Interpreter won’t recognize a match between the same lowercase and uppercase letter. To convert the user input to all lowercase, use the lower function:
if choice. lower() in [“set a trap”, “set trap”, “trap”, “make a trap”, “make trap”]

Go through and make sure all of your inputs are converted to lowercase.
Share the link to your Python code with your teacher in REPL. it by clicking on the share button and copying the link. Also, submit your pseudocode.

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 23.06.2019 14:30
Select the correct answer. a company wants to use online methods to target more customers. it decides to conduct a market research by collecting the data of a few customers with their consent. they want to track data of the sites that their customers frequently visit. which software can the company? a. spyware b. bots c. adware d. trojan horse e. rootkits
Answers: 1
question
Computers and Technology, 23.06.2019 19:00
Write a program that displays the following menu: geometry calculator 1. calculate the area of a circle 2. calculate the area of a rectangle 3. calculate the area of a triangle 4. quit enter your choice (1-4): if the user enters 1, the program should ask for the radius of the circle and then display its area. use the following formula: area = ď€(the square of r) use 3.14159 for ď€ and the radius of the circle for r. if the user enters 2, the program should ask for the length and width of the rectangle and then display the rectangle’s area. use the following formula: area = length * width if the user enters 3, the program should ask for the length of the triangle’s base and its height, and then display its area. use the following formula: area = base * height * .5 if the user enters 4, the program should end. input validation: display an error message if the user enters a number outside the range of 1 through 4 when selecting an item from the menu. do not accept negative values for the circle’s radius, the rectangle’s length or width, or the triangle’s base or height. note: if the user enters an improper menu choice (1-4), the program prints "the valid choices are 1 through 4. run the program again and select one of those." if the user enters a negative radius, the program prints "the radius can not be less than zero." if the user enters a negative value for height or base, the program prints "only enter positive values for base and height."
Answers: 1
question
Computers and Technology, 23.06.2019 21:50
Description: write function lastfirst() that takes one argument—a list of strings of the format "lastname, firstname" —and returns a list consisting of two lists: (a) a list of all the last names (b) a list of all the first names
Answers: 2
question
Computers and Technology, 23.06.2019 22:00
Technician a says engine assemblies can be mounted longitudinally in a chassis. technician b says engine assemblies can be mounted transversely in a chassis. who is correct?
Answers: 2
You know the right answer?
Now, it’s time for you to begin coding your text-based adventure game! Starting at the top, convert...
Questions
question
History, 30.11.2020 18:50
Questions on the website: 13722361