首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > perl python >

python通用的列表解析构造

2012-08-22 
python通用的列表解析结构通用的列表解析结构如下:[expression for target1 in iterable1 [if condition1]

python通用的列表解析结构

通用的列表解析结构如下:

[expression for target1 in iterable1 [if condition1]

? ?for target1 in iterable2 [if condition2]

? ?for target1 in iterable3 [if condition3]

? ?for target1 in iterable4 [if condition4]

? ?... .... ... .... ... ... ... ... ... ... ... ... ... ... .

??for targetN in iterableN [if conditionN]]

例如:

?

print rs == rx #True
?

热点排行