Skip to content
UPEEC

Booleans and None

True/False drive conditions; None represents "no value".

Beginner
Comments 0

True and False are the two bool values. In conditions Python also treats values as truthy or falsy: 0, 0.0, "", [], {} and None are falsy; most other values are truthy.

None means "nothing here" — for example a function with no return returns None. Check for it with is:

if result is None:
    print("No reading yet")

Spotted a mistake or want to add detail? Suggest an improvement — Content Contributors' edits are reviewed by editors before they go live.

Discussion (0)

Sign in or join free to ask questions and discuss this topic.