Answered step by step
Verified Expert Solution
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
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
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started