171k views
21 votes
Does anybody know how to do 6.3 code practice on edhesive. NEED ASAP!!!​

User Macbeth
by
3.2k points

1 Answer

11 votes

Answer:

Hopes this helps if not comment and I'll change it

Step-by-step explanation:

import simplegui

import random

def draw_handler(canvas):

for i in range (0, 1000):

x = random.randint(1, 600)

y = random.randint(1, 600)

r = random.randint(0, 255)

g = random.randint(0, 255)

b = random.randint(0, 255)

color = "RGB( " + str(r) + "," + str(g) + "," + str(b) + ")"

canvas.draw_point((x, y), color)

frame = simplegui.create_frame('Points', 600, 600)

frame.set_canvas_background("Black")

frame.set_draw_handler(draw_handler)

frame.start()

User Bobu
by
3.4k points