Verifique se a variável não é nenhuma

a = None
b = 5
print((a, isinstance(a, type(None))))    
print((b, isinstance(b, type(None))))
Real Raccoon