module>
NameError: name 'bar' is not defined
>>> bar = None
>>> print(bar)
None
在有的语言中,如果定义了变量,但是没有赋值...' object has no attribute 'age'
>>> setattr(None, 'age', 5)
Traceback (most recent call last):
File..."", line 1, in
AttributeError: 'NoneType' object has no attribute 'age'
>>> setattr(...type(None), 'age', 5)
Traceback (most recent call last):
File "", line 1, in
TypeError...Traceback (most recent call last):
File "", line 1, in
TypeError: type 'NoneType' is