wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

Python Intro Var and Data Types

Total questions: 20

Worksheet time: 10mins

Name
Class
Date
1.

1. What are variables?

a)

containers for storing data

b)

things that can never change

c)

a piece of characters

2.

3. The data type for strings is denoted as _______

a)

int()

b)

str()

c)

float()

3.

4. The data type for whole numbers is denoted as _______

a)

int()

b)

str()

c)

float()

4.

5. Whole numbers are also known as __________.

a)

integers

b)

strings

c)

float

5.

6. The data type for fractional numbers or decimals is denoted as ______________.

a)

int()

b)

str()

c)

float()

6.

7. Which is the correct command for assigning values to a variable?

a)

variable = "your name"

b)

variable * 22

c)

variable is equal to "this"

7.

8. Which of the following is a variable with a float data type?

a)

variable = 22.47

b)

variable = float_type

c)

variable = 12

8.

9. How do you perform an addition in python?

a)

2 plus 2

b)

2 * 2

c)

2 + 2

9.

10. Which of these divisions will print only the remainder in python?

a)

8 % 3

b)

8 / 3

c)

8 divided by 3

10.
What does the print function do in python?
a)
It's a variable.
b)
It can input data.
c)

It displays an output

d)
It loops the code.
11.

What is the output from the following code?

print ("hello world")

a)

Hello

b)

hello world

c)

print hello world

d)

world

12.

What are the 3 things variables have?

a)

Name

Type

Value

b)

Bus

Car

Cycle

c)

Air

Water

Gas

d)

Maths

English

Science

13.

Name = "John"

Age = 23

What type of data is stored in the variable name?

a)

String

b)

Number

c)

Boolean

d)

Boat

14.

What is the Name of the programming language we are learning?

a)

Instagram

b)

C++

c)

Python

d)

Cheetah

15.

What type of variable is 5

a)

String

b)

Boolean

c)

Integer

d)

Float

16.

What type of variable is "peanut butter"?

a)

String

b)

Boolean

c)

Integer

d)

Float

17.

What type of variable is -7?

a)

String

b)

Boolean

c)

Integer

d)

Float

18.

What type of variable is 8.9?

a)

String

b)

Boolean

c)

Integer

d)

Float

19.

What type of variable is false?

a)

String

b)

Boolean

c)

Integer

d)

Float

20.

How do you declare a variable in Python?

a)

value : variable_name

b)

variable_name = value

c)

value = variable_name

d)

variable_name : value