Answer to Question #164005 in Python for Haruna

Question #164005

Modify the program from Lab 3 to show the shades of green and then move the turtle forward 300 steps without writing (use the penup() and pendown() turtle functions) and repeat the same loop, but backwards.

Your output should look similar to:


1
Expert's answer
2021-02-15T16:37:43-0500
#import turtle module
import turtle
#set color mode
turtle.colormode(255)
#create a turtle object
tess=turtle.Turtle()
tess.shape("turtle")
tess.backward(100)
#using loop draw first half
for i in range(0,255,10):
tess.forward(10)
#pen size increases with i
tess.pensize(i)
#i represents blue color
tess.color(0,0,i)
#same as above loop but in reverse
for i in range(255,0,-10):
tess.forward(10)
#pen size increases with i
tess.pensize(i)
#i represents blue color
tess.color(0,0,i)

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
APPROVED BY CLIENTS