Wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Python Datatypes

Total questions: 13

Worksheet time: 13mins

Name
Class
Date
1.

What are the possible values for a boolean datatype

a)

Yes, No

b)

Ok, Cancel

c)

True, False

d)

0, 1

2.

What are the two sub categories of numeric data type?

a)

int, float

b)

String, text

c)

bool, text

d)

int, str

3.

'int' can contain only

a)

decimals

b)

whole numbers

c)

0 and 1

d)

true or false

4.

Casting is the process of​ (a)  

Choose from the below words
Converting one datatype to another
Selecting suitable actors
Assigning values
5.

Match the following

a)

int

1.

whole numbers

b)

bool

2.

true or false

c)

str

3.

text

d)

float

4.

decimal numbers

e)

int

5.

0

6.

Match the outputs

a)

int(3)

1.

3

b)

float(3)

2.

3.0

c)

str(3.0)

3.

'3.0'

d)

int(3.0)

4.

3

e)

float('3.0')

5.

3.0

7.

The input() always converts the user-input to

a)

boolean

b)

int

c)

float

d)

text

8.

0.0​ (a)  

Choose from the below words
Float
int
str
bool
9.

'0.0'​ (a)  

Choose from the below words
str
bool
int
float
10.

What's wrong with the following code?

Float("33.71")

(a)  

Choose from the below words
float should be in lowercase
the speech marks should be single
float does not support str conversion
it should have been Float(33.71)
11.

What will be the value of c in the following program if the user inputs 3 for a and 5 for b?

a = input("Enter number 1")

b = input("Enter number 2")

c = a * b

a)

35

b)

3 * 5

c)

15

d)

Program Error

12.

What will be the value of c in the following program if the user inputs 3 for a and 5 for b?

a = input("Enter number 1")

b = input("Enter number 2")

c = a - b

a)

2

b)

-2

c)

Program Error

d)

3-5

13.

What will be the value of c in the following program if the user inputs 3 for a and 5 for b?

a = input("Enter number 1")

b = input("Enter number 2")

c = a + b

a)

8

b)

35

c)

3 + 5

d)

Program Error