python 布尔值

 布尔值

s = user=='alex' and pwd== "12" or 1==1 and pwd =="pwd"    
s = user=='alex' and pwd== "12" or 1==1 
s = not False
补充
     先计算括号内
     执行顺序
     从前到后
         结果
        True OR ==> True
        True AND ==> 继续走
        False OR ==> 继续走
        False AND ==> False

user == 'alex' and (pwd == '123' or 1 == 1)
user = 'alex
pwd = '123

user == 'alex' and pwd == '123' or 1 ==1 and pwd == ''7689

 

posted @ 2019-01-30 23:05  Boks  阅读(245)  评论(0)    收藏  举报