Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

IN PYTHON WRITE A PROGRAM: Write a program that allows a user to type an interactive series of commands which would control the turtle. Here

IN PYTHON WRITE A PROGRAM:

Write a program that allows a user to type an interactive series of commands which would control the turtle. Here are the possible commands:

DEG - Sets the number of degrees (N_deg) which will be used for a future turn (Defaults to 90 if not set)

L - Turns left N_deg degrees (defaults to 90 if DEG not previously called)

R - Turns left N_deg degrees (defaults to 90 if DEG not previously called)

DIST - Sets the distance in pixels (N_dist) which will be used for a future F (forward command) (Defaults to 10 if not set)

F - Moves the turtle forward N_dist number of pixels (Defaults to 10)

RED - Sets the pen to red

BLUE - Sets the pen to blue

GREEN - Sets the pen to green

BLACK - Set the pen to black (the default)

UP - Picks the pen up

DOWN - Puts the pen down

Q - Quits the program

Note that each one of these commands should call its own Function (Def). In the case of te F, L, and R commands, those functions should be sent a parameter indicating the distance or the number of degrees.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Design Application And Administration

Authors: Michael Mannino, Michael V. Mannino

2nd Edition

0072880678, 9780072880670

More Books

Students also viewed these Databases questions

Question

Will it take too long?

Answered: 1 week ago

Question

2. How were various roles filled?

Answered: 1 week ago

Question

2. What process will you put in place to address conflicts?

Answered: 1 week ago