wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

Python Data Types and Control Statements Quiz

Total questions: 15

Worksheet time: 8mins

Name
Class
Date
1.

What is a built-in datatype in Python?

a)

Tuple

b)

Dictionary

c)

Set

d)

List

2.

Which of the following is a sequence datatype in Python?

a)

List

b)

Boolean

c)

Dictionary

d)

Set

3.

What type of operator is used for addition in Python?

a)

Identity

b)

Arithmetic

c)

Logical

d)

Relational

4.

Which statement is used to create a loop that continues until a condition is false?

a)

break statement

b)

while Loop

c)

if statement

d)

for Loop

5.

What is the purpose of the 'continue' statement in loops?

a)

To pause the loop

b)

To skip the current iteration

c)

To restart the loop

d)

To exit the loop

6.

Which of the following is NOT a control statement in Python?

a)

print statement

b)

while Loop

c)

for Loop

d)

if statement

7.

What does the 'break' statement do in a loop?

a)

Continues to the next iteration

b)

Exits the loop

c)

Pauses the loop

d)

Restarts the loop

8.

Which of the following is a user-defined data type in Python?

a)

Set

b)

Tuple

c)

List

d)

Class

9.

What is the purpose of the 'return' statement in a function?

a)

To exit the function

b)

To pass control to the caller

c)

To return a value to the caller

d)

To create a loop

10.

Which operator is used to check membership in a sequence?

a)

Logical

b)

Relational

c)

Membership

d)

Identity

11.

What is the correct syntax for an if statement in Python?

a)

if: condition do_something

b)

if condition then do_something

c)

if (condition) do_something

d)

if condition: do_something

12.

Which of the following is a reserved word in Python?

a)

function

b)

class

c)

def

d)

method

13.

What type of operator is used to assign a value to a variable?

a)

Assignment

b)

Logical

c)

Relational

d)

Bitwise

14.

Which statement allows multiple conditions to be checked in Python?

a)

while Loop

b)

if statement

c)

if...else statement

d)

if...elif...else statement

15.

What is the purpose of literals in Python?

a)

To create functions

b)

To control flow

c)

To represent fixed values

d)

To define variables