Question
18. Turtle Graphics: Hypnotic Pattern
Use a loop with the turtle graphics library to draw the design shown in Figure 4-15
Use a loop with the turtle graphics library to draw the design shown in Figure 4-140. Figure 4-14 Star pattern 18. Turtle Gra

On Python code with Turtle
18. Turtle Graphics: Hypnotic Pattern
use a loop with the turtle graphics library to draw the design shown in Figure 4-15


18. Turtle Graphics: Hypnotic Pattern Use a loop with the turtle graphics library to draw the design shown in Figure 4-150 Fi
image.png
0 0
Add a comment Improve this question Transcribed image text
Answer #1
import turtle

# import turtle

win = turtle.Screen()

win.screensize(400 * 400)

# create window screen with 400 * 400 width and height

tur = turtle.Turtle()

n = 4

# initialize n= 4

for i in range(2 * n):

    # find the value of angle and make turtle to rotate by that angle

    angle = 180 - 180 / n

    tur.forward(200)

    tur.right(angle)

turtle.done()

import turtle # import turtle win = turtle.Screen() win.screensize(400 * 400) # create window screen with 400 * 400 width andPython Turtle Graphics

# import turtle
import turtle
# create screen of 400 * 400 width and height
win =turtle.Screen()
win.screensize(400 * 400)
# create turtle object
tur = turtle.Turtle()
# move turtle to its left by 90 degrees
tur.left(90)
# this for loop runs till 150 with the step count by 4
for i in range(0, 150, 4):
    # move turtle to forward direction for a distance of i+4 and make it rotate by 90 degree to its left
    tur.forward(i+5)
    tur.left(90)
turtle.done()


# import turtle import turtle # create screen of 400 * 400 width and height win =turtle.Screen() win.screensize(400 * 400) #Python Turtle Graphics - O X

Add a comment
Know the answer?
Add Answer to:
18. Turtle Graphics: Hypnotic Pattern Use a loop with the turtle graphics library to draw the...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT