Create the lines of code to do the following:
Check to see if the variable, called data, equals a specific value.
If the value is "GO" then output the following: "Moved to the next room"
If the value is "RIGHT" then output the following: "Turned 90 degrees to the right"
If the value is "LEFT" then output the following: "Turned 90 degrees to the left"
If the value is "STOP" then output the following: "Staying in this location"
Anything else outputs the following: "Invalid option!"
(Python)
Write a python program that will match the value of variable "data" and print the message accordingly:
If the value is "GO" then output the following: "Moved to the next room"
If the value is "RIGHT" then output the following: "Turned 90 degrees to the right"
If the value is "LEFT" then output the following: "Turned 90 degrees to the left"
If the value is "STOP" then output the following: "Staying in this location"
Anything else outputs the following: "Invalid option!"
Step by stepSolved in 2 steps with 2 images
- Flowchart,code and outputarrow_forward) Circle the data type of each indicated variable from the code below. var1 = input("prompt") var2 = open(var1, "r") var3 = print(var1) var4 = var1.split()arrow_forwardLAB ASSIGNMENTS, CONT. 2. sandwich.py - follow the instructions below. You may adjust the food items to include your personal favorites. • It uses all of our standard mipo_ex features. • The menu should have numbered or letter options. Sandwich Maker Write a program that asks users for their sandwich preferences. The program should use PylnputPlus to ensure that they enter valid input, such as: Using inputMenu() for a bread type: wheat, white, or sourdough. Using inputMenu() for a protein type: chicken, turkey, ham, or tofu. Using inputYesNo() to ask if they want cheese. If so, using inputMenu() to ask for a cheese type: cheddar, Swiss, or mozzarella. Using inputYesNo() to ask if they want mayo, mustard, lettuce, or tomato. Using inputlnt() to ask how many sandwiches they want. Make sure this number is 1 or 120 00T 110 more. Come up with prices for each of these options, and have your program display all the choices and their prices plus a total cost at the very end. 3 130arrow_forward
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education