最新国产好看的视频,伊人天堂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)論

陆川县| 镇原县| 永仁县| 伊通| 犍为县| 姜堰市| 潼南县| 晋城| 福建省| 股票| 塔城市| 武川县| 连江县| 江达县| 措勤县| 左贡县| 拜泉县| 尚义县| 曲阳县| 满城县| 体育| 三原县| 璧山县| 深圳市| 新余市| 九江市| 武定县| 桃江县| 青神县| 兴化市| 伊吾县| 夏邑县| 英吉沙县| 化隆| 揭东县| 宜春市| 敦煌市| 龙山县| 罗甸县| 中卫市| 铁岭市|