Answered step by step
Verified Expert Solution
Question
1 Approved Answer
This is in Python Write a program randomCirclesAnimation(picture, iterations) which takes as input a picture and the number of random circles to be drawn. Create
This is in Python
Write a program randomCirclesAnimation(picture, iterations) which takes as input a picture and the number of random circles to be drawn. Create an animation of black circles at random positions and random radii drawn on the provided picture.
- Use import random before you start writing your program.
- Initialize all variables you may need.
- Create a loop counting the iterations. Inside this loop, use random.randint to create random coordinates x and y for the center of a circle, and a random radius between 1 and 20 pixels wide. Use addOvalFilled to draw the circles. This function will clip the filled circle automatically, so you do not have to worry about parts of the circle being outside your picture. Repaint your picture after a circle has been drawn.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started