None
is a powerful tool in the Python toolbox. Like True
and False
, None
is an immutable keyword. As the null
in Python, you use it to mark missing values and results, and even default parameters where it’s a much better choice than mutable types.
Now you can:
- Test for
None
withis
andis Not
- Choose when
None
is a valid value in your code - Use
None
and its alternatives as default parameters - Decipher
None
andNoneType
in your tracebacks - Use
None
andOptional
in type hints
Congratulations, you made it to the end of the course! What’s your #1 takeaway or favorite thing you learned? How are you going to put your newfound skills to use? Leave a comment in the discussion section and let us know.
Agil C on July 30, 2020
Thanks for the video..!