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)
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 step
Solved in 2 steps with 2 images