wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Unit 1-4 Review

Total questions: 35

Worksheet time: 18mins

Name
Class
Date
1.

Which shape has an optional parameter called roundness that determines how closely it resembles a circle?

a)

Oval

b)

Rect

c)

Star

d)

Circle

2.

What parameter can be used to change the way the text looks in a label created with the Label function?

a)

Bold

b)

Italic

c)

Font

d)

Size

3.

Which parameter is used to set the thickness of a line drawn with the Line function?

a)

lineWidth

b)

border

c)

dashes

d)

opacity

4.

For which shape is the align parameter the only property that CANNOT be changed after the shape is defined?

a)

Polygon

b)

Arc

c)

Circle

d)

Line

5.

What is the default color for the fill parameter in all shapes?

a)

Black

b)

White

c)

Red

d)

Green

6.

In the RGB color model, what does the first value represent?

a)

Intensity of Blue

b)

Intensity of Red

c)

Intensity of Green

d)

Intensity of Black

7.

Which shape does NOT have an optional parameter called size to control the font size of the text?

a)

Line

b)

Oval

c)

Polygon

d)

Label

8.

What is the purpose of using the pass statement in a function?

a)

To terminate the function execution

b)

To skip the function entirely

c)

To tell Python to do nothing for that function

d)

To pass arguments to the function

9.

Which of the following is a legal function name in Python?

a)

2hello

b)

hello world

c)

Say_hi

d)

helloWorld

10.

How are parameters and arguments related in a function?

a)

They can be used interchangeably

b)

They must match in number and order

c)

Arguments are optional, parameters are mandatory

d)

Parameters are only used for mouse events

11.

What does the onMousePress(mouseX, mouseY) function do?

a)

Adds a shape to the canvas

b)

Prints the mouse coordinates

c)

Executes when the mouse is released

d)

Modifies existing shapes on mouse press

12.

What is the purpose of using the print statement in coding, especially during debugging?

a)

To display information for users

b)

To delete code

c)

To help understand and debug the code

d)

To access the inspector

13.

When is top-level code executed in a Python program?

a)

After any event is called

b)

Before any event is called

c)

Only when mouse events occur

d)

When the program terminates

14.

Which arithmetic operator is used to divide in Python?

a)

+

b)

-

c)

*

d)

/

15.

To modify a shape after creating it, what should you do?

a)

Use the delete statement

b)

Store the shape in a local variable

c)

Store the shape in a global variable

d)

Use the += operator

16.

What is a property that cannot be changed after a shape is initialized?

a)

borderWidth

b)

Align

c)

Size

d)

RotateAngle

17.

Which shape-specific property is associated with the Circle shape?

a)

points

b)

roundness

c)

radius

d)

size

18.

What is the purpose of the onMouseMove(x, y) function?

a)

Called when the mouse is pressed and moved

b)

Runs only if a specific condition is true

c)

Called every time the mouse is moved and not pressed

d)

Defines a helper function

19.

When does the onMouseDrag(x, y) function get called?

a)

When the mouse is pressed and not moved

b)

When the mouse is moved and not pressed

c)

Every time the mouse is moved and not pressed

d)

When the mouse is pressed and moved

20.

What is the purpose of an if statement in Python?

a)

To define a helper function

b)

To run code regardless of conditions

c)

To run code only if a specified condition is true

d)

To call another function

21.

What happens if the condition in an if statement is false, and there is an else statement?

a)

The code in the else body is skipped

b)

The code in the else body is always executed

c)

The code in the if body is skipped

d)

The program terminates

22.

Which comparison operator is used to check if x is less than or equal to y?

a)

(x < y)

b)

(x <= y)

c)

(x == y)

d)

(x >= y)

23.

What is the primary purpose of using helper functions in programming?

a)

To create mouse events

b)

To define conditions in if statements

c)

To help another function perform its work

d)

To manually call other functions

24.

What is the recommended way to check if two values are equal in an if statement?

a)

(x = y)

b)

(x != y)

c)

(x == y)

d)

(x >= y)

25.

Can functions use parameters from another function?

a)

Yes, always

b)

No, functions cannot use parameters from another function

c)

Only if the functions are defined in the same file

d)

Only if the functions have the same number of parameters

26.

What is the purpose of using elif in an if-elif-else statement?

a)

To add another test after the first one

b)

To run code only if the first test is False

c)

To represent the arrow keys

d)

To initialize custom properties

27.

When does the code in an else body run?

a)

Only if the first test is True

b)

Regardless of whether the tests before it were True or False

c)

Only if the test before it is False

d)

Only if there is no elif statement

28.

When is the onKeyPress function called?

a)

When a key is released

b)

When a key is pressed

c)

When the user clicks the mouse

d)

When a shape is clicked

29.

Which parameter is used in the onKeyPress function to test which key was pressed?

a)

keyCode

b)

keyName

c)

key

d)

keyPressed

30.

What does the onKeyRelease function do?

a)

Calls onKeyPress function

b)

Runs code when a key is pressed

c)

Runs code when a key is released

d)

Initializes custom properties

31.

How are custom properties added to shapes?

a)

By using app.stop()

b)

By using the contains method

c)

By using toFront() and toBack() methods

d)

By assigning values directly, like c.count = 0

32.

Which method brings a shape to the front of other shapes?

a)

bringFront()

b)

toFront()

c)

contains()

d)

addPoint()

33.

What does the contains(x, y) method do?

a)

Adds a point to a polygon

b)

Checks if a shape contains another shape

c)

Tests if a shape hits another shape

d)

Tells if a shape contains a specific point (x, y)

34.

When is app.stop() called?

a)

When a key is pressed

b)

When a shape is clicked

c)

When we want no more events to happen

d)

When a key is released

35.

In the RGB color model, what does the second value represent?

a)

Intensity of Blue

b)

Intensity of Red

c)

Intensity of Gray

d)

Intensity of Green