Question: 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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!