Which of the following is an example of a boolean expression in Python?
x = 5result = "True"y > 10float_num = 3.14
What is the result of the expression print(5 + 3) in Python?
What is the result of the expression print("5" + "3") in Python?
Which of the following is a valid Python variable name?
123variablemy_variablebreakelse
Step through this pseudocode. What will be output?
What does the modulus operator % do in Python?
- Returns the quotient of a division
- Multiplies two numbers
- Returns the remainder of a division
- Raises a number to a power
What is the correct syntax to declare and initialise a string variable in Python?
str name = "Hello"var Hello = "name"var Hello = "name"name = "Hello"
Which of the following best describes the purpose of iteration in programming?
- To execute a block of code only if a condition is true
- To execute instructions in a specific order
- To repeat a set of instructions a certain number of times or until a condition is met
- To create reusable code
In Python, which keyword is used to exit a loop prematurely?
Which SQL clause is used to filter records based on a specified condition?