Question
1. Square Flower You can have the turtle draw an interesting owerlike shape by drawing n squares. Each n-square ower is drawn after turning the
1. Square Flower You can have the turtle draw an interesting owerlike shape by drawing n squares. Each n-square ower is drawn after turning the turtle by some number of degrees between each square. (see Figure 1 for an example) (a) Type1: A 5-square red ower. (b) A 15-square blue ower. Figure 1: Two types of n-square owers Using the following implementation of draw square() function write a function named draw ower() that takes a turtle, the number n of squares to draw, the side length and a color as parameters and draws an n-square ower by repeating the function drawsquare() n times. Test your code by drawing a yellow 21-square ower with side length of 200. def draw_square ( aTurtle , sideLength ) : for i in range (4) : aTurtle . forward ( sideLength ) aTurtle . left (90)
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