Wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

PythonDataTypes

Total questions: 20

Worksheet time: 13mins

Name
Class
Date
1.

What is a String?

a)

A data type that contains whole numbers. eg: 3, 45, 124

b)

Numbers with decimal point. eg: 0.5, 2.45, 56.04

c)

Group of characters between quotation marks. eg: "dog"

d)

Data type that can only be True or False.

2.

A variable is a named value that can be changed in the program.

a)

False

b)

True

3.

Which writes a message for the user?

a)

input()

b)

myVar="Hi"

c)

print("Hello!")

d)

max=100

4.

Below are the valid data types in Python EXCEPT

a)

int

b)

float

c)

char

d)

decimel

5.

Which if the values below return TRUE if executed?

a)

10 > 3

b)

10 < 3

c)

10 >< 3

d)

10 <> 3

6.

Which variable uses a integer data type?

a)

password

b)

passwordScore

c)

passwordLength

7.

What is the content of variable c after the following Python code is executed?

a = 34

b = 0.56 - 7.5j

c = a + b

a)

34.56

b)

34.56 - 7.5j

c)

27.06

d)

Error message

8.

What is the output of the following Python code?

a = 13.5

b = -24.6

a, b = b, a

print(a, b)

a)

13.5 -24.6

b)

-24.6 13.5

c)

-13.5 24.6

d)

13.5 24.6

9.

What will be the output from the following Python code?

print("3+4")

a)

7

b)

3+4

c)

34

d)

SyntaxError

10.

Python is _____ sensitive which means you must use the same indentation every time.

a)

space

b)

colour

c)

code

d)

word

11.
What is the correct definition for a VARIABLE?
a)
a changeable value, such as a score in a computer game.
b)
a value that cannot be changed
12.

What is the output for this line of code: print(type(8))

a)

<class 'bool'>

b)

<class 'str'>

c)

<class 'int'>

d)

<class 'float'>

13.

What is the output for this line of code: print(type('I love Quizizz!"))

a)

<class 'bool'>

b)

<class 'str'>

c)

<class 'int'>

d)

error

14.

Which of the following is invalid variable?

a)

_a = 1

b)

__a = 1

c)

__str__ = 1

d)

none of the mentioned

15.

The expression Int(x) implies that the variable x is converted to integer.

a)

True

b)

False

16.

Is Python case sensitive when dealing with identifiers?

a)

yes

b)

No

c)

Machine Dependent

d)

None of the mentioned

17.

The expression int(x) implies that the variable x is converted to integer. State whether true or false.

a)

True

b)

False

18.

What is the maximum possible length of an identifier?

a)

31 characters

b)

63 characters

c)

79 characters

d)

unlimited in length

19.

Mathematical operations can be performed on a string. State whether true or false.

a)

True

b)

False

20.

What do you think about our training progress for today?

a)

Too fast

b)

Just about right

c)

Too slow