PythiloLesson 7 of 30 · progress kept in this browser

None, the missing value

None is Python's value for "nothing here". A function that ends without return gives back None, and so does print.

def find_user(name):
    if name == "ada":
        return "Ada Lovelace"

user = find_user("bob")
if user is None:
    print("not found")
result = print("hi")
print(result)  # None

There is only one None object, so test for it with x is None and x is not None, not with ==.

Your task

Write describe_score(score) returning "no score" when score is None and f"score: {score}" otherwise, where 0 is a real score. Write pick(value, default) returning default only when value is None, and value otherwise.