Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

The program is Python 2.1 Stairs 2.1.1 DrawSquare Create a function called drawSquare, which takes in a turtle and a number called square Size and

The program is Python

image text in transcribed

image text in transcribed

image text in transcribed

2.1 Stairs 2.1.1 DrawSquare Create a function called drawSquare, which takes in a turtle and a number called square Size and uses that turtle to draw a square with each side squareSize pixels long. Your function should start like this: # myTurtle is the turtle doing the drawing # size is the length of each of the sides of the square. def drawSquare (myTurtle, squareSize): pass 2.1.2 Drawing a Row of Squares Write a function called drawRow that draws a row of squares. drawRow should call (use) drawSquare to accomplish this task. See the comments in the code for more details. # draws a row of squares # myTurtle is the turtle doing the drawing # length is how many squares are in the row # squareSize is the length of each of the sides of each square. def drawRow(myTurtle, length, squareSize): pass Figure 1: The output of drawRow(bob,5,50). 2.1.3 Drawing a Grid Write a function called drawGrid that draws a square grid of squares. drawGrid should call (use) drawRow to accomplish this task. See the comments in the code for more details. # myTurtle is the turtle doing the drawing # the grid will be "size" squares wide and "size" squares tall # squareSize is the length of each of the sides of each individual square. def drawGrid(myTurtle, size, squareSize): pass Figure 2: Output of drawGrid(bob,5,50). 2.1.4 Drawing a Stair of Squares Write a function called drawSquareStairs that draws a staircase made of squares, like in Figure 3. drawSquareStairs should call (use) drawRow to ac- complish this task. See the comments in the code for more details. # myTurtle is the turtle doing the drawing # height is how tall the stairs are going to be # squareSize is the length of each of the sides of each square. def drawSquareStairs (myTurtle, height, squareSize): Figure 3: Output of drawSquareStairs (bob,5,50)

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 Development And Administration

Authors: Michael V. Mannino

4th Edition

0615231047, 978-0615231044

More Books

Students also viewed these Databases questions

Question

=+ (b) If ax(I) A(An I) for all I and if a > 0, then A( A) = 1.

Answered: 1 week ago

Question

Consider this article:...

Answered: 1 week ago

Question

a. How are members selected to join the team?

Answered: 1 week ago

Question

b. Will new members be welcomed?

Answered: 1 week ago

Question

c. Will leaders rotate periodically?

Answered: 1 week ago