One of my APIs give a json output
{"student":{"id": null}}
I tried comparing this null value in the following ways but none is working
if(student['id'] == "null")
if(student['id'] == None)
if(student['id'] == null)
What is the correct way to compare null values?
Full code:
students = [{"id":null},{"id":1},{"id":3}]
for student in students:
if(student['id'] is not None):
print("found student" + str(student['id']))
break