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
  • Turtle Graphics with nested loop: Write a turtle graphics python program repeat_squares.py that uses nested loops...

    Turtle Graphics with nested loop: Write a turtle graphics python program repeat_squares.py that uses nested loops to draw 100 squares, to create this design: Turtle-squares.png starting with the smallest square in the bottom right-hand corner. Start at position (-4,4). At each step increase the length of each side by 4 pixels. Draw 100 squares. Please submit with an animation speed of 0 and the turtle hidden turtle.hideturtle()

  • Please use python language to solve this problem. 3. Use turtle graphics to draw a spiral...

    Please use python language to solve this problem. 3. Use turtle graphics to draw a spiral as below. It does not have to look exactly like the one below, but it should be a path that spirals around a point many times. Upload a file called spiral py. When we run it using the python command it should draw the picture without any further modification. Hint: use a for or while loop Figure 3: spiral

  • using repl.it can you screenshot your repl.it please Project 3. Draw a Snowman Write a program...

    using repl.it can you screenshot your repl.it please Project 3. Draw a Snowman Write a program that uses turtle graphics to display a snowman as shown below. In this program you will write numbers of functions and brings all of them under the main to draw the final shape. The functions you need are: draw_base) - This function should draw the base of the snowman, which is the large snowball at the bottom draw_mid_section () - This function should draw...

  • I need help with turtle graphics assignment in python 3, please! Write a program named Lastname_firstname_clock.py to display a clock face with hands showing the current time. The radius of the clock...

    I need help with turtle graphics assignment in python 3, please! Write a program named Lastname_firstname_clock.py to display a clock face with hands showing the current time. The radius of the clock face (the distance from the center to the hour markers) is 150. The hour hand has length 100, and the minute hand has a length of 120 You may design the clock in one of three ways: using the square cursor shape (hint: stamp)) for the hour markers...

  • Design and implement a single program: • to produce a simple graphical representation of a set...

    Design and implement a single program: • to produce a simple graphical representation of a set of regular pentagons, as shown in Figure 1 (below). The output should consist of 4 pentagons with sides of length 20, 40, 60 and 80 respectively, nested as shown. A regular pentagon has 5 sides and the inner angle of a regular pentagon is 72 degrees. The distance between any two successive pentagons should be the same: there should be 10 units (measured as...

  • 18-10 A common method of making coaxial lines is to use a very thin outer conductor,...

    18-10 A common method of making coaxial lines is to use a very thin outer conductor, that is, the radii c and b of Figure 18-1 are nearly equal. Show that under these conditions the contribu- tion of the outer conductor to the self-inductance becomes approximately (Aol/8πb)(c-b) and We were unable to transcribe this image(3b) + -In b) 4 (18-34) Figure 18-1. A coaxial line carrying equal currents in opposite directions.

  • Identify and correct the mistakes of code. Identify and draw table for the circuit. library ieee;...

    Identify and correct the mistakes of code. Identify and draw table for the circuit. library ieee; 1 use ieee.std_logic_1164.all; 2 3 entity mux4x1_seq is 4. 5 port 6 ip0: ip1: ip2: ip3 in std_logic; 7 in std_logic_vector(0 to 1); out std_logic}; 9 op end mux4x1_seq}; 10 11 architecture beh of mux4x1_seq is 12 13 |begin 14 P_mux: process (ip0,ip1,ip2,ip3,s); variable temp: std_logic; 15 16 begin 17 case s is 18 temp ip0; when "00" => 19 when "01" temp ip1;...

  • Use a loop to find the sum of all numbers between 0 and #mystery_int, including bounds...

    Use a loop to find the sum of all numbers between 0 and #mystery_int, including bounds (meaning that if #mystery_int = 7, you add 0 + 1 + 2 + 3 + 4 + 5 + 6 + 7). However, there's a twist: mystery_int might be negative. #So, if mystery_int was -4, you would -4 + -3 + -2 + -1 + 0. Coding Problem 3.3.3 (External resource) 3.0 points possible) SumLoop.py 1 mystery_int -3 loop to find the sum...

  • the picture above is the one you are supposed to use for the MATlab code please...

    the picture above is the one you are supposed to use for the MATlab code please help Problems. Grayscale images are composed of a 2D matrix of light intensities from O (Black) to 255 (White). In this lab you will be using grayscale images and do 2D-array operations along with loops and iflelse branches. 1. We can regard 2D grayscale images as 2D arrays. Now load the provided image of scientists at the Solvay Conference in 1927 using the imread)...

  • Dle Edit Search View Encoding Language Settings Tools Macro Run Plugins Window 1 isport turtle 3 ...

    dle Edit Search View Encoding Language Settings Tools Macro Run Plugins Window 1 isport turtle 3 tina turtle.Turtle 4 SCreen-turtle.Screen ) 5 acreen.bgoolor ("white") 6 tina.shape ("turtle" 7tina.pencolor ("blue") SCALE -20 10 12 13 14 15 16 17 18 19 20 21 input: n # output: a drawing of n concentric circles centered at 0,0 # this function is written using iteration (using a loop) Edef concentric loop (n) : for size in range(n) : tina.penup tina goto (O, -SCALE...

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
ADVERTISEMENT