please code in python Here's an example created by rotating a square 9 times: Write a Python program that will produce our simplified "spirograph" images from squares.  Your program should include a function: spiro(num, side) that takes two arguments: the number of squares to draw in one revolution, and the side length of each square in the figure.  Remember: there are 360 degrees in a circle.    Here is a function that demonstrates how to draw a randomly colored filled square.  You’ll want to copy-paste this function into your program, and call this function from within a loop in your spirograph function, so that it draws multiple squares:   import turtle, random turtle.speed(0) turtle.delay(0)   def filled_square(side):     r = random.random()     g = random.random()     b = random.random()     turtle.color(r,g,b)     turtle.begin_fill()     for i in range(4):         turtle.forward(side)         turtle.left(90)     turtle.end_fill()

Systems Architecture
7th Edition
ISBN:9781305080195
Author:Stephen D. Burd
Publisher:Stephen D. Burd
Chapter7: Input/output Technology
Section: Chapter Questions
Problem 6VE
icon
Related questions
Question

please code in python

Here's an example created by rotating a square 9 times:

Write a Python program that will produce our simplified "spirograph" images from squares.  Your program should include a function: spiro(num, side) that takes two arguments: the number of squares to draw in one revolution, and the side length of each square in the figure.  Remember: there are 360 degrees in a circle. 

 

Here is a function that demonstrates how to draw a randomly colored filled square.  You’ll want to copy-paste this function into your program, and call this function from within a loop in your spirograph function, so that it draws multiple squares:

 

import turtle, random

turtle.speed(0)

turtle.delay(0)

 

def filled_square(side):

    r = random.random()

    g = random.random()

    b = random.random()

    turtle.color(r,g,b)

    turtle.begin_fill()

    for i in range(4):

        turtle.forward(side)

        turtle.left(90)

    turtle.end_fill()

Python Turtie Graphics
Transcribed Image Text:Python Turtie Graphics
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps with 2 images

Blurred answer
Knowledge Booster
Function Arguments
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Recommended textbooks for you
Systems Architecture
Systems Architecture
Computer Science
ISBN:
9781305080195
Author:
Stephen D. Burd
Publisher:
Cengage Learning
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
Fundamentals of Information Systems
Fundamentals of Information Systems
Computer Science
ISBN:
9781337097536
Author:
Ralph Stair, George Reynolds
Publisher:
Cengage Learning
Programming Logic & Design Comprehensive
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781305480537
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
Microsoft Visual C#
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,