wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

Python Quiz 2

Total questions: 5

Worksheet time: 25mins

Name
Class
Date
1.

What is a variable in Python?

a)

A constant value

b)

A reserved keyword

c)

A named container for storing data

d)

A type of loop

2.

Which of the following is a valid variable name in Python?

a)

2count

b)

total_score

c)

break

d)

class

3.

What is the purpose of the assignment operator (=) in Python?

a)

To compare two values

b)

To perform mathematical operations

c)

To assign a value to a variable

d)

To declare a variable

4.

Which data type is used to represent a single character in Python?

a)

a. char

b)

b. string

c)

c. character

d)

d. str

5.

x = 5

y = x + 2

print(y)

a)

5

b)

7

c)

10

d)

Error