摘要:
while True: pass while 1: pass #效果相同,后者 效果更快 s = 1 y = bool (s) #结果为True,int只要不是0,就为真 s = 'abc' y = bool (s) #结果为True,str型有数值,就为真 s while s : pass #可以直接判断,这样引用,s直接是空数据,为False 阅读全文
摘要:
print(0 and 2 > 1) #结果0 print(0 and 2 1) #结果True print(1 and 2 1 and 0) #结果0 print(2 1 and 1) #结果1 print(2 1) #结果True print(0 or 2 1) #结果1 print(1 or 2 1 or 0) #结果True print(2 1 or 1) #结果Tru... 阅读全文