国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 編程 > Python > 正文

在Python中使用成員運算符的示例

2020-02-23 01:11:56
字體:
來源:轉載
供稿:網友

下表列出了所有Python語言支持的成員運算符。

2015513122253479.jpg (586×176)

 例如:

試試下面的例子就明白了所有的Python編程語言提供會員運算符:

#!/usr/bin/pythona = 10b = 20list = [1, 2, 3, 4, 5 ];if ( a in list ):  print "Line 1 - a is available in the given list"else:  print "Line 1 - a is not available in the given list"if ( b not in list ):  print "Line 2 - b is not available in the given list"else:  print "Line 2 - b is available in the given list"a = 2if ( a in list ):  print "Line 3 - a is available in the given list"else:  print "Line 3 - a is not available in the given list"

當執行上面的程序它會產生以下結果:

Line 1 - a is not available in the given listLine 2 - b is not available in the given listLine 3 - a is available in the given list

發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 纳雍县| 岳普湖县| 长宁县| 沾化县| 偃师市| 三江| 遂宁市| 建昌县| 确山县| 敦煌市| 衢州市| 黄龙县| 扶余县| 城口县| 东乡| 温州市| 永城市| 焦作市| 平阴县| 香港 | 介休市| 马边| 宁安市| 布尔津县| 天门市| 墨竹工卡县| 宜阳县| 云安县| 蕉岭县| 滨州市| 麦盖提县| 白河县| 唐海县| 左权县| 达尔| 栾城县| 惠水县| 乃东县| 鹤壁市| 柘城县| 中西区|