wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

Python Data Types and Operations Quiz

Total questions: 11

Worksheet time: 6mins

Name
Class
Date
1.

What is the result of the following operation in Python: 7 + 3*2?

a)

20

b)

13

c)

17

d)

10

2.

Which function is used to convert a string to an integer in Python?

a)

str()

b)

int()

c)

float()

d)

bool()

3.

What will be the output of the following code: `print("Hello" + " " + "World")`?

a)

HelloWorld

b)

Hello World

c)

Hello, World

d)

"Hello World"

4.

Which of the following is not a valid arithmetic operator in Python?

a)

+

b)

-

c)

&

d)

/

5.

What is the data type of the result of the following operation: 5/25 / 2 ?

a)

Integer

b)

Float

c)

String

d)

Boolean

6.

How do you convert a float to a string in Python?

a)

str()

b)

int()

c)

float()

d)

bool()

7.

What is the result of the following operation: 10%310 \% 3 ?

a)

1

b)

3

c)

0

d)

2

8.

Which function is used to convert an integer to a float in Python?

a)

str()

b)

int()

c)

float()

d)

bool()

9.

Which of the following is a valid string in Python?

a)

'Hello'

b)

"World"

c)

"""Python"""

d)

All of the above

10.

What is the result of the following operation: 2**3 in Python?

a)

6

b)

8

c)

9

d)

12

11.

How do you concatenate two strings in Python?

a)

Using the + operator

b)

Using the * operator

c)

Using the & operator

d)

Using the - operator