Solved

Why "is None" and not "== None"?

FreyaLOP

Both seem to work.

2

Comments 5

Join the discussion

Already have an account? Log in

  1. JackStack Solutionreplies: 2

    None is a singleton, so is checks identity, which is exact and fast. == can be overridden by objects to return weird things. PEP 8 recommends is None.

    4
    1. EmmaCodesreplies: 1

      Important part of this stage: don't write if not temperature_c: — that treats 0 °C as missing!

      2