WorksheetsPython Programming Quiz
Total questions: 39
Worksheet time: 20mins
What is the purpose of the print() function in Python?
To add comments
To create variables
To display output
To perform arithmetic operations
Which of the following is an arithmetic operator in Python?
+
>
==
and
What does the % operator do in Python?
Adds two numbers
Calculates the remainder
Compares two values
Multiplies two numbers
What is the purpose of comments in Python?
To create variables
To explain code
To execute code
To format strings
What is the essential question for Sprint 1.2?
How to format strings?
What are the different conditions in Python programming?
How to do arithmetic calculations in Python?
How to print arithmetic operations using the print function?
What does an if statement do in Python?
Executes code based on a condition
Creates a loop
Defines a function
Declares a variable
What is the difference between if and if-else?
if-else has no conditions
if-else is only for strings
if-else executes alternative code
if is used for loops
What is a Boolean expression?
An expression that creates lists
An expression that formats strings
An expression that returns true or false
An expression that returns a number
What is the purpose of the if-elif-else statement?
To define a function
To format strings
To handle multiple conditions
To create a loop
What is the essential question for Sprint 3.1?
How to format strings?
How to print arithmetic operations?
What are the different conditions in Python programming?
How to add items to a list in Python?
What does string slicing allow you to do?
Change the string
Access parts of a string
Create a new string
Delete a string
Which method is used to add an item to a list?
append()
add()
insert()
extend()
What is the essential question for Sprint 2.2?
What are the different conditions in Python programming?
How to do arithmetic calculations in Python?
How to format strings?
How is if-elif-else different from if and if-else?
What is the purpose of the Student Grade Book project?
To practice string formatting
To learn about loops
To create a game
To manage student scores
What does the term 'mutability' refer to in lists?
The ability to delete a list
The ability to create a list
The ability to change the list
The ability to sort a list
Which of the following is NOT a comparison operator?
<
>
++
==
What is the output of print(2 + 3)?
2 + 3
5
23
Error
What is the purpose of the 'pass/fail' criteria in the Student Grade Book?
To determine student grades
To add comments
To create a list
To format strings
What does the term 'indexing' refer to in strings?
Accessing characters by position
Formatting a string
Creating a new string
Deleting a character
What is the essential question for Sprint 3.2?
How to format strings?
How to add items to a list in Python?
How to do arithmetic calculations in Python?
What are the different conditions in Python programming?
Which of the following is a built-in method for lists?
remove()
delete()
clear()
print()
What is the output of print('Hello, World!')?
Error
Hello World!
Hello, World!
'Hello, World!'
What is the purpose of the 'format()' method in strings?
To change the string's case
To format strings with variables
To delete parts of a string
To create a new string
What is the output of print(5 % 2)?
2
5
1
Error
What is the purpose of the 'append()' method in lists?
To add an item to the end
To sort the list
To remove an item
To create a new list
What is the essential question for Sprint 1.1?
How to format strings?
What are the different conditions in Python programming?
How to print arithmetic operations using the print function?
How to do arithmetic calculations in Python?
What is the purpose of indentation in Python?
To add comments
To format strings
To define code blocks
To create variables
What is the output of print('Python' + ' is fun!')?
Python is fun!
Error
Python + is fun!
Pythonisfun!
What does the len() function do in Python?
Calculates the length of a string or list
Formats a string
Creates a new list
Deletes an item from a list
What is the purpose of the 'return' statement in a function?
To define a variable
To end the function
To pass data back to the caller
To create a loop
What is the output of print(3 * 4)?
7
Error
12
34
Which of the following is a valid way to create a list in Python?
list = ()
list = []
list = {}
list = ''
What does the 'len()' function do in Python?
Creates a new list
Deletes an item
Returns the length of an object
Formats a string
What is the output of print(10 // 3)?
Error
4
3.33
3
What does the 'break' statement do in a loop?
Pauses the loop
Ends the loop
Continues to the next iteration
Exits the program
What is the purpose of the 'for' loop in Python?
To iterate over a sequence
To define a function
To perform arithmetic operations
To create a conditional statement
What is the output of print('Hello' * 3)?
Hello 3
Hello + Hello + Hello
HelloHelloHello
Error
What does the 'sorted()' function do in Python?
Reverses a list
Sorts a list
Creates a new list
Deletes a list
What is the purpose of the 'input()' function in Python?
To format strings
To take user input
To display output
To create a loop
