The following program uses the stamp method to create an X of turtle shapes as shown below, but the lines are mixed up. The program should do all necessary set-up, create the turtle, set the shape to “turtle”, and pick up the pen. Stamp the blue turtles before you stamp the green ones.
The following program uses the stamp method to create two squares of turtle shapes as shown below, but the lines are mixed up. The program should do all necessary set-up, create the turtle, set the shape to “turtle”, and pick up the pen. Draw the blue square before you draw the green one.
from turtle import *
nick = Turtle()
nick.shape("turtle")
nick.penup()
---
nick.goto(-150,-150)
nick.left(90)
---
nick.goto(-150,-150)
nick.right(90) #distractor
---
nick.color("blue")
for count in range(4):
for num in range(5):
nick.stamp()
nick.forward(30)
nick.right(90)
---
nick.goto(-120,-120)
nick.color("green")
for count in range(4):
---
for num in range(3):
---
for num in range(2): #distractor
---
nick.stamp()
nick.forward(30)
---
nick.right(90)
---
nick.left(90) #distractor
In the program below, we want to draw a series of polygons, from 10 sides down to 3 sides, each with a side length of 100. The polygon procedure is provided as is starter code for the main part of the program. Add a loop and use it to call polygon. Make sure that you draw everything from a 10-sided to a 3-sided polygon, counting down (10, 9, 8, … 3). Each shape should have a size (side length) of 100.