Welcome to Westonci.ca, where you can find answers to all your questions from a community of experienced professionals. Our platform connects you with professionals ready to provide precise answers to all your questions in various areas of expertise. Get quick and reliable solutions to your questions from a community of experienced experts on our platform.

6.3 Code Practice

You should see the following code in your programming environment:

import simplegui

def draw_handler(canvas):
# your code goes here

frame = simplegui.create_frame('Testing', 600, 600)
frame.set_canvas_background("Black")
frame.set_draw_handler(draw_handler)
frame.start()


Use the code above to write a program that, when run, draws 1000 points at random locations on a frame as it runs. For an added challenge, have the 1000 points be in different, random colors.

Sagot :

Answer:

Use the canvas code to draw 1000 points but then for the location import the random module and use random.randrange() for it

Explanation:

The drawing object will be used for drawing

The random class is used for the random numbers

I hope it helps