← Quiz: References and Copying: all 10 questions
Quiz: References and Copying · Question 4 of 10
When should you use is instead of ==?
When should you use is instead of ==?
- A.When checking whether a value is None
- B.When comparing two strings
- C.When comparing two numbers
- D.Whenever the values are lists
Answer & explanation
Correct answer: When checking whether a value is None
There is only one None object, so is None is the correct and clear check. Use == for values.
Can you get the rest right without peeking?
Take the timed Quiz: References and Copying quiz free. Pass it to earn XP and count towards your certificate.
Start the quiz →