最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

python運算符號詳細介紹

 更新時間:2021年12月27日 10:35:30   作者:是數(shù)學系的小孩兒  
大家好,本篇文章主要講的是python運算符號詳細介紹,感興趣的同學趕快來看一看吧,對你有幫助的話記得收藏一下,方便下次瀏覽

比較運算符

在這里插入圖片描述

a,b=10,30
print('a>b嗎?',a>b)
print('a<b嗎?',a<b)
print('a<=b嗎?',a>=b)
print(a is b)#這個比較的是id標識
a>b嗎? False
a<b嗎? True
a<=b嗎? False
False

一個變量有三部分組成:1標識,2類型,3值
比較對象的標識使用is

布爾運算符

在這里插入圖片描述

print(a==1 and b==2)#ture and true-->ture
print(a==1 and b<2)#ture and false-->false
print(a!=1 and b==2)#false and ture-->false
print(a!=1 and b!=2)#false and false -->false
print('---------------or 或者-----------------------------------------')
print(a==1 or b==2)#ture or true-->ture
print(a==1 or b<2)#ture or false-->ture
print(a!=1 or b==2)#false or ture-->ture
print(a!=1 or b!=2)#false and false -->false
print('---------------not 對運算數(shù)取反-----------------------------------------')
f=True
f2=False
print(not f)
print(not f2)
print('---------------in 與not in-----------------------------------------')
s='helloworld'
print('w'in s)
print('k'in s)
print('w'not in s)
print('k'not in s)
True
True
False
False
False
---------------or 或者-----------------------------------------
True
True
True
False
---------------not 對運算數(shù)取反-----------------------------------------
False
True
---------------in 與not in-----------------------------------------
True
False
False
True

python中的位運算符

在這里插入圖片描述
在這里插入圖片描述

運算符的優(yōu)先級

在這里插入圖片描述
在這里插入圖片描述
在這里插入圖片描述

到此這篇關于python運算符號詳細介紹的文章就介紹到這了,更多相關python運算符內容請搜索腳本之家以前的文章或繼續(xù)瀏覽下面的相關文章希望大家以后多多支持腳本之家!

相關文章

最新評論

应用必备| 隆回县| 芮城县| 海安县| 甘德县| 鄂州市| 平安县| 佛学| 鄂尔多斯市| 宿松县| 南陵县| 夏河县| 海淀区| 佛坪县| 双流县| 那曲县| 陇川县| 巩留县| 甘德县| 东方市| 罗平县| 宁陕县| 商水县| 宁乡县| 光山县| 内丘县| 石渠县| 依安县| 浙江省| 尉犁县| 贡觉县| 木兰县| 油尖旺区| 墨脱县| 光泽县| 汶上县| 赣榆县| 陆河县| 舒城县| 墨竹工卡县| 临西县|