Write a program to move the Turtle based on the user’s request. Display a menu with options for the user to choose. Use the following guidelines to write your program.


1. Create a menu that gives the user options for moving the Turtle. The menu should contain letters or numbers that align with movements such as forward, backward, and/or drawing a particular pattern.

2. Use at least one if-else or elif statement in this program. It should be used to move the Turtle based on the user's input.

3. A loop is optional but may be used to ask the user to select multiple choices.

4. Use one color other than black.

Respuesta :

Answer:

#import turtle

import turtle

 

# set screen

Screen = turtle.Turtle()

 

# decide colors

cir= ['red','green','blue','yellow','purple']

 

# decide pensize

turtle.pensize(4)

 

# Draw star pattern

turtle.penup()

turtle.setpos(-90,30)

turtle.pendown()

for i in range(5):

   turtle.pencolor(cir[i])

   turtle.forward(200)

   turtle.right(144)

 

turtle.penup()

turtle.setpos(80,-140)

turtle.pendown()

 

# choose pen color

turtle.pencolor("Black")

# importing turtle module

import turtle

 

# number of sides

n = 10

 

# creating instance of turtle

pen = turtle.Turtle()

 

# loop to draw a side

for i in range(n):

   # drawing side of  

   # length i*10

   pen.forward(i * 10)

 

   # changing direction of pen  

   # by 144 degree in clockwise

   pen.right(144)

 

# closing the instance

turtle.done()

turtle.done()

Explanation: