subject

Edhesive 6.1 Code Practice Copy and paste the following code into the programming environment below and work through the exercises.

import simplegui
import random

frameWidth = 500

def draw_handler(canvas):

for i in range (1, 3000):

r = random. randint(0,255)
g = random. randint(0,255)
b = random. randint(0,255)

randRGBColor = "RGB( " + str(r) + "," + str(g) + "," + str(b) + ")"
backg = "RGB( " + str(255) + "," + str(255) + "," + str(255) + ")"

x = random. randint(2, frameWidth)
y = random. randint(2, frameWidth)

canvas. draw_point((x, y), randRGBColor)
frame. set_canvas_background(backg)

frame = simplegui. create_frame('Howdy - I love this program', frameWidth, frameWidth)
frame. set_draw_handler(draw_handler)
frame. start()

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 02:10
3. (5 points) describe what would be printed by the code below or what error would occur. const char* cstr = "0123456"; const char* ptr = & cstr[4]; cout < < ptr[-1] < < ptr < < endl; 1 4. (5 points) theseus has been trapped in a maze with a minotaur, which is trying to capture him. each round, theseus and the minotaur move through the maze; theseus towards the exit, and the minotaur towards theseus. theseus can move in any of the four cardinal directions, or he can wait for a round to see how the minotaur moves. write code that creates a data type to represent the possible moves that theseus could make.
Answers: 3
question
Computers and Technology, 22.06.2019 17:30
Under which key category do the page up and page down keys fall? page up and page down keys fall under the keys category.
Answers: 1
question
Computers and Technology, 23.06.2019 00:00
How do we use the sumif formula (when dealing with different formats) ?
Answers: 1
question
Computers and Technology, 24.06.2019 02:30
Write the pseudo code for this problem based on what you learned from the video. the purpose is to design a modular program that asks the user to enter a distance in kilometers, and then converts that distance to miles. the conversion formula is as follows: miles = kilometers x 0.6214
Answers: 3
You know the right answer?
Edhesive 6.1 Code Practice Copy and paste the following code into the programming environment below...
Questions
question
Mathematics, 06.05.2020 05:28
question
Mathematics, 06.05.2020 05:28
Questions on the website: 13722360