NEW
Font size
WorksheetsQuiz: Programming Basics Review
Total questions: 10
Worksheet time: 5mins
What is the purpose of an if statement?
To repeat code
To make decisions
To define a variable
To display output
Which of the following is NOT a valid variable name?
user_name
2nd_place
favoriteColor
total_amount
What does a return statement do in a function?
Prints output to the screen
Ends the program
Sends a value back to the caller
Defines a new variable
Which symbol is used for assignment in Python?
==
=
:
=>
What is the output of print(5 + "5")?
10
"55"
Error
None
What is the main advantage of using functions?
They make programs longer
They help avoid repetition and improve readability
They replace all loops
They make the program run faster
Which of these is an example of a loop?
if-else
for
return
In event-driven programming, what triggers the execution of code?
A user action (click, input, etc.)
A specific time
The operating system
Randomly
What will the following code output?
Hello
"Hello"
test()
Nothing
What is Tkinter used for?
Data analysis
Web development
Creating graphical user interfaces
Running machine learning models
