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

講解Python中的標(biāo)識(shí)運(yùn)算符

 更新時(shí)間:2015年05月14日 10:12:08   投稿:goldensun  
這篇文章主要介紹了講解Python中的標(biāo)識(shí)運(yùn)算符,是Python學(xué)習(xí)當(dāng)中的基礎(chǔ)知識(shí),需要的朋友可以參考下

 下表列出了所有Python語言支持的標(biāo)識(shí)運(yùn)算符。

2015514101018679.jpg (589×219)

示例:

試試下面的例子就明白了所有Python編程語言提供的標(biāo)識(shí)運(yùn)算符:

#!/usr/bin/python

a = 20
b = 20

if ( a is b ):
  print "Line 1 - a and b have same identity"
else:
  print "Line 1 - a and b do not have same identity"

if ( id(a) == id(b) ):
  print "Line 2 - a and b have same identity"
else:
  print "Line 2 - a and b do not have same identity"

b = 30
if ( a is b ):
  print "Line 3 - a and b have same identity"
else:
  print "Line 3 - a and b do not have same identity"

if ( a is not b ):
  print "Line 4 - a and b do not have same identity"
else:
  print "Line 4 - a and b have same identity"

當(dāng)執(zhí)行上面的程序它會(huì)產(chǎn)生以下結(jié)果:

Line 1 - a and b have same identity
Line 2 - a and b have same identity
Line 3 - a and b do not have same identity
Line 4 - a and b do not have same identity


相關(guān)文章

最新評(píng)論

奎屯市| 呈贡县| 冀州市| 建瓯市| 镇康县| 衡阳市| 福清市| 静安区| 巍山| 荆门市| 正蓝旗| 周至县| 云梦县| 高邑县| 泸州市| 平定县| 天全县| 彰化县| 景德镇市| 台湾省| 铁力市| 普兰县| 娱乐| 南靖县| 凤庆县| 浦北县| 稻城县| 大姚县| 罗田县| 名山县| 昆山市| 苗栗县| 阳东县| 诸城市| 右玉县| 尼木县| 上犹县| 嫩江县| 天等县| 烟台市| 理塘县|