Wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Python_Unit 6 Graphics Review (6.1-6.6)

Total questions: 20

Worksheet time: 11mins

Name
Class
Date
1.

What is a set of commands that work together to complete a similar goal/task?

a)

module

b)

function

c)

def

d)

for loop

2.

We use FOR loops instead of WHILE loops when:


(select all)

a)

You do not know how many times you want the loop to run

b)

You know how many times you want the loop to run

c)

When you need to ask the user for input

d)

When there is a definite starting and ending point

3.

____, _____,______, are used for color

a)

Red, Green, Blue

b)

Red, Orange, Blue

c)

Black, White, Yellow

d)

Blue, Green, Red

4.

What type of color code is this?


#AE7DFF

a)

RGB

b)

Hexadecimal

c)

HTML

d)

CSS

5.

Color codes are stored as ______.


Hint:

randRGBColor = "RGB( " + "30" + "," + str(g) + "," + "255"+ ")"

a)

Integers

b)

Decimals (Floats)

c)

Strings

d)

Real Data

6.

Where do X,Y coordinates begin in Python?

a)

upper left hand corner

b)

center of screen

c)

upper right hand corner

d)

lower right hadn corner

7.

What does this line of code do?


import simplegui

a)

Brings in the simplegui functions

b)

Imports the for function

c)

Draws a box

d)

Imports simple stuff

8.

Consider this code: Which variable sets up the space to draw?

import simplegui


def draw_handler(canvas):

canvas.draw_text("Coding Rocks!", (50, 50), 20, "Aqua")


frame = simplegui.create_frame("Home",800,800)

frame.set_draw_handler(draw_handler)

frame.start()

a)

canvas.draw

b)

frame=simplegui.create_frame

c)

"Aqua"

d)

import simplegui

9.

Which function will draw shapes?

a)

random.randint

b)

draw_polygon

c)

draw_line

d)

draw_text

10.

The order of drawing parameters when coding Python are...?

a)

width, (x,y), color

b)

(x,y), width, color

c)

color, (x,y), width

d)

(x,y), color, width

11.

What does 800,800 represent?


frame = simplegui.create_frame("Home", 800, 800)

a)

the location of the frame

b)

the size of the frame

c)

the color of the frame

d)

the range of the frame

12.

How many times does this loop run?


for r in range (80):

a)

79 (zero to seventy-eight)

b)

80 (zero to seventy-nine)

c)

81 (zero to eighty)

d)

80 (one to seventy-nine)

13.

For graphics to work, the following command is necessary.

a)

frame.set_canvas_background("White")

b)

import simplegui

c)

import random

d)

x = random.randint(100, 150)

14.

Which function would you use to draw a circle?

a)

draw_point

b)

draw_polygon

c)

draw_circle

d)

draw_text

15.

What does the 100 represent?


canvas.draw_text(“Hello”, (50,100), 8, “blue”)

a)

x location

b)

y location

c)

size

d)

color

16.

What does the 80 represent?


canvas.draw_point( [80,100], “yellow”)

a)

x location

b)

y location

c)

color

d)

size

17.

What color is the inside of the circle?


canvas.draw_circle((200,210), 100, 3, "Green","Yellow")

a)

Green

b)

Yellow

18.

What numbers will the for loop run through?


for x in range(8)

a)

[0,1,2,3,4,5,6,7]

b)

[0,1,2,3,4,5,6,7,8]

c)

[1,2,3,4,5,6,7]

d)

[-0,1,2,3,4,5,6,7,8]

19.

What numbers will the for loop run through?


for r in range(3, 9)

a)

[3,4,5,6,7,8,9]

b)

[3,4,5,6,7,8]

c)

[0,1,2,3,4,5,6,7,8]

d)

[1,2,3,4,5,6,7,8]

20.

What do 400 and 600 represent?


simplegui.create_frame( “Main”, 400, 600)

a)

color of the frame

b)

size of the frame

c)

location of the frame

d)

movement of frame