tupledict.select()
tupledict.select()
选择( 图案 )返回A.列表
包含与匹配指定元组模式匹配的键关联的值。该模式应该为键元组中的每个字段提供一个值。一种'*'
值表示该字段中接受任何值。
没有参数,此方法返回所有值的列表托布利特
。
论点:
图案:用于匹配关键元组的模式。
示例用法:
d = tupledict([(((1,2),'oneetwo'),((1,3),'onethree'),((2,3),'twothree')])打印(d.select())#打印['onetwo','onethree','twothree']打印(d.select(1,'*'))#prints ['onetwo','onethree'] print(d.select('*',3))#打印['onethree','twothree'] print(d.select(1,3))#prints ['onethree']