Python - Operators and Expression Evaluation
Find the error in this code snippet:
a = None
if a is not None:
print("Value exists")
else
print("No value")a = None
if a is not None:
print("Value exists")
else
print("No value")else line is missing a colon at the end, which is required in Python.is not with None is correct, and None is a keyword, so no quotes needed. Indentation looks fine.is not operator15+ quiz questions · All difficulty levels · Free
Free Signup - Practice All Questions