wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

Quiz: Programming Basics Review

Total questions: 10

Worksheet time: 5mins

Name
Class
Date
1.

What is the purpose of an if statement?

a)

To repeat code

b)

To make decisions

c)

To define a variable

d)

To display output

2.

Which of the following is NOT a valid variable name?

a)

user_name

b)

2nd_place

c)

favoriteColor

d)

total_amount

3.

What does a return statement do in a function?

a)

Prints output to the screen

b)

Ends the program

c)

Sends a value back to the caller

d)

Defines a new variable

4.

Which symbol is used for assignment in Python?

a)

==

b)

=

c)

:

d)

=>

5.

What is the output of print(5 + "5")?

a)

10

b)

"55"

c)

Error

d)

None

6.

What is the main advantage of using functions?

a)

They make programs longer

b)

They help avoid repetition and improve readability

c)

They replace all loops

d)

They make the program run faster

7.

Which of these is an example of a loop?

a)

if-else

b)

for

c)

return

d)

print

8.

In event-driven programming, what triggers the execution of code?

a)

A user action (click, input, etc.)

b)

A specific time

c)

The operating system

d)

Randomly

9.

What will the following code output?

a)

Hello

b)

"Hello"

c)

test()

d)

Nothing

10.

What is Tkinter used for?

a)

Data analysis

b)

Web development

c)

Creating graphical user interfaces

d)

Running machine learning models