Font size
WorksheetsPython Variables
Total questions: 1
Worksheet time: 7mins
1-10.
Answer the questions below after watching the video
What is the primary purpose of a variable in programming?
To store information for later use
To perform calculations
To create new programs
To print messages to the screen
What are the three components of a variable?
Function, Value, Operation
Syntax, Logic, Output
Class, Object, Method
Name, Type, Value
What does the type 'int' represent in Python?
A character
A decimal number
A boolean value
An integer
What type of variable is used to store text?
Bool
Int
Str
Float
Which of the following is an example of a string?
True
-3.2
'Hello World'
50
Which variable type can have a decimal component?
Float
Bool
Str
Int
How do you create or update a variable in Python?
With a single equal sign
By declaring its type explicitly
Using a question mark
Through a special function
What signifies a variable's name in an assignment statement?
It's followed by parentheses
It's on the left side of the equal sign
It's inside quotes
It's on the right side of the equal sign
What does the 'type' function in Python do?
Converts one type to another
Calculates mathematical operations
Prints the type of a variable
Creates a new type
What is the output of the 'type' function when used on a string variable?
'Int'
'Str'
'Bool'
'Float'
