如题所述
这里要注意两个点:
1、while 1: 等效于while bool(1):
bool(1) = True 所以1是一个永真条件。
同样的 while "abc": 一样是永真条件。
2、Python的bool类型(True False),继承于int对象,True=1和False=0