0 / 2 embers
0 / 3000 xp
click for more info
Complete a lesson to start your streak
click for more info
Difficulty: 4
click for more info
No active XP Potion
Accept a Quest
Login to submit answers
Not all variables have a value. We can make an "empty" variable by setting it to None
. None
is a special value in Python that represents the absence of a value. It is not the same as zero, False, or an empty string.
my_mental_acuity = None
The value of my_mental_acuity
in this case is None
until we use the assignment operator, =
, to give it a value.
NoneType is not the same as a string with a value of "None":
my_none = None # this is a None-type
my_none = "None" # this is a string with the value "None"
Declare a variable named enemy
and set it to None
. Don't change the print()
function.
Focus Editor
Alt+Shift+]
Login to Submit
Login to Run
Login to view solution