wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Python Variables

Total questions: 1

Worksheet time: 7mins

Name
Class
Date

1-10.

Answer the questions below after watching the video

1.

What is the primary purpose of a variable in programming?

a)

To store information for later use

b)

To perform calculations

c)

To create new programs

d)

To print messages to the screen

2.

What are the three components of a variable?

a)

Function, Value, Operation

b)

Syntax, Logic, Output

c)

Class, Object, Method

d)

Name, Type, Value

3.

What does the type 'int' represent in Python?

a)

A character

b)

A decimal number

c)

A boolean value

d)

An integer

4.

What type of variable is used to store text?

a)

Bool

b)

Int

c)

Str

d)

Float

5.

Which of the following is an example of a string?

a)

True

b)

-3.2

c)

'Hello World'

d)

50

6.

Which variable type can have a decimal component?

a)

Float

b)

Bool

c)

Str

d)

Int

7.

How do you create or update a variable in Python?

a)

With a single equal sign

b)

By declaring its type explicitly

c)

Using a question mark

d)

Through a special function

8.

What signifies a variable's name in an assignment statement?

a)

It's followed by parentheses

b)

It's on the left side of the equal sign

c)

It's inside quotes

d)

It's on the right side of the equal sign

9.

What does the 'type' function in Python do?

a)

Converts one type to another

b)

Calculates mathematical operations

c)

Prints the type of a variable

d)

Creates a new type

10.

What is the output of the 'type' function when used on a string variable?

a)

'Int'

b)

'Str'

c)

'Bool'

d)

'Float'