WorksheetsCS1_L4 mcq
Total questions: 10
Worksheet time: 5mins
What is the main purpose of a variable in Python? p1
To repeat code
To store information for later use
To stop a program
To print output
In the statement coins = 3, what is the value being stored? p1
coins
=
integer
3
What symbol is used as the assignment operator in Python? p1
==
::
=
→
Which data type represents decimal numbers? p1
Integer
Boolean
String
Float
Which of the following is a Boolean value? p5
A. "True"
B. True
C. 3.5
D. "False"
What happens during reassignment of a variable? p7
The variable is deleted
All previous values are saved
The most recent value replaces the old one
The variable name changes
What does it mean to reference a variable? p8
Printing the variable
Creating a new variable
Using the variable name to access its value
Assigning a new value
What does a method do when it returns a value? p9
Ends the program
Gives back information
Deletes a variable
Prints output
In the statement enemy = hero.findNearestEnemy(), what is stored in enemy? p9
The hero
A Boolean value
A string
The closest enemy
Which term describes changing the value stored in a variable? p7
Reference
Assign
Return
Reassignment
