Final answer:
The program provides a menu-driven approach allowing users to control Turtle movements in Python. Utilizing a loop and if-else statements, users can command the Turtle to move forward, backward, turn, draw a circle, or exit. A blue-colored Turtle ensures compliance with the instructions.
Step-by-step explanation:
The task requires us to write a program using the Turtle graphics library in Python. The program should display a menu with options for the user to control the movements of the Turtle. Here is a simple example of how we could accomplish this task:
import turtle
# Set up the Turtle
scr = turtle.Screen()
scr.bgcolor("white")
t = turtle.Turtle()
t.color("blue")
# Function to display the menu
def display_menu():
print("Options:")
print("1. Move Forward")
print("2. Move Backward")
print("3. Turn Left")
print("4. Turn Right")
print("5. Draw Circle")
print("6. Exit")
running = True
while running:
display_menu()
choice = input("Enter your choice:")
if choice == '1':
t.forward(100)
elif choice == '2':
t.backward(100)
elif choice == '3':
t.left(90)
elif choice == '4':
t.right(90)
elif choice == '5':
t.circle(50)
elif choice == '6':
running = False
else:
print("Invalid choice, please select a valid option.")
# Close the window on click
scr.exitonclick()
In this program, we define a menu for the user with options that include moving forward, backward, turning left or right, drawing a circle, and exiting the program. We use an if-else statement to determine the Turtle's movement based on the user's choice. The user can make multiple choices in a loop until they decide to exit by choosing the "Exit" option. The Turtle is set to blue color to fulfill the requirement of using a color other than black.