Login to manage your account

Please enter a valid email address.
Forgot Password?
Please enter a valid password.
OR

Don't have an account yet? Sign up

What does the 'is' operator compare?

  1. A Object identity, whether both names refer to the same object
  2. B Value equality
  3. C Type only
  4. D String content
Answer

Object identity, whether both names refer to the same object

Use == for value comparison and 'is' only for singletons such as None. Small integer and string caching can make 'is' appear to work by accident.

All Python MCQs

Login to manage your account

Please enter a valid email address.
Forgot Password?
Please enter a valid password.
OR

Don't have an account yet? Sign up as