Question: I am stuck on a python program... I am supposed to draw this parallelogram shape using turtle... i am not able to orient the turtle

I am stuck on a python program... I am supposed to draw this parallelogram shape using turtle... i am not able to orient the turtle to draw the next... I attached my code below

I am stuck on a python program... I am supposed to draw

import turtle import math

#Ask user for numerical value of lenght S = eval(input("Enter a numerical value"))

#calculate lenght of parallelogram length = S /math.cos(math.pi/4)/2

#starting point for parallelogram turtle.penup() turtle.goto(-150,length /2) turtle.pendown()

#start drawing parallelogram (side 1) turtle.begin_fill() turtle.color("pink") turtle.forward(length) turtle.right(135) turtle.forward(length) turtle.right(45) turtle.forward(length) turtle.right(135) turtle.forward(length) turtle.left(45) turtle.penup() turtle.end_fill() turtle.pendown()

#Draw side 2 turtle.begin_fill() turtle.color("red") turtle.forward(length) turtle.left(135) turtle.forward(length) turtle.left(45) turtle.forward(length) turtle.left(135) turtle.forward(length) turtle.right(45) turtle.end_fill()

#Draw side 3 turtle.begin_fill() turtle.color("orange") turtle.forward(length) turtle.left(135) turtle.forward(length) turtle.left(45) turtle.forward(length) turtle.left(135) turtle.forward(length) turtle.right(45) turtle.end_fill()

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

Given the diagram the goal is to draw a series of parallelograms that form a star shape The turtle n... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!