bugl
bugl
HomeLearnPatternsPathsSearch
HomeLearnPatternsPathsSearch

Loading lesson path

Learn/Python/Foundations
Python•Foundations

Python None

Flash cards

Review the key moves

1/4
Core idea

What is the main idea behind Python None?

Lesson checks

Practice each idea before moving on

Short Mimo-style checks built from this lesson's code, terms, and sequence.

1Quick choice

Which statement best captures the main point of this lesson?

2Order

Put the learning moves in the order that makes the concept easiest to apply.

Its data type is NoneType , and None is the only instance of a NoneType object.
None is a special constant in Python that represents the absence of a value.
Functions returning None

None is a special constant in Python that represents the absence of a value.

Its data type is NoneType , and None is the only instance of a NoneType object.

NoneType

Variables can be assigned None to indicate "no value" or "not set".

None

Use type() to see the type of a None value.

None

Comparing to None

To compare a value to None , use the identity operator is or is not

is
is not

True or False

None evaluates to False in a boolean context.

Example

print(bool(None))

Functions returning None

Functions that do not explicitly return a value return None by default.

None

Previous

Python String Formatting

Next

Python User Input