NEW
Font size
WorksheetsPython Data Types and Control Statements Quiz
Total questions: 15
Worksheet time: 8mins
What is a built-in datatype in Python?
Tuple
Dictionary
Set
List
Which of the following is a sequence datatype in Python?
List
Boolean
Dictionary
Set
What type of operator is used for addition in Python?
Identity
Arithmetic
Logical
Relational
Which statement is used to create a loop that continues until a condition is false?
break statement
while Loop
if statement
for Loop
What is the purpose of the 'continue' statement in loops?
To pause the loop
To skip the current iteration
To restart the loop
To exit the loop
Which of the following is NOT a control statement in Python?
print statement
while Loop
for Loop
if statement
What does the 'break' statement do in a loop?
Continues to the next iteration
Exits the loop
Pauses the loop
Restarts the loop
Which of the following is a user-defined data type in Python?
Set
Tuple
List
Class
What is the purpose of the 'return' statement in a function?
To exit the function
To pass control to the caller
To return a value to the caller
To create a loop
Which operator is used to check membership in a sequence?
Logical
Relational
Membership
Identity
What is the correct syntax for an if statement in Python?
if: condition do_something
if condition then do_something
if (condition) do_something
if condition: do_something
Which of the following is a reserved word in Python?
function
class
def
method
What type of operator is used to assign a value to a variable?
Assignment
Logical
Relational
Bitwise
Which statement allows multiple conditions to be checked in Python?
while Loop
if statement
if...else statement
if...elif...else statement
What is the purpose of literals in Python?
To create functions
To control flow
To represent fixed values
To define variables
