#!/usr/bin/env python #def f1(x) : # return x > 22 ret = filter(lambda x : x > 22 ,[11,22,33,44]) print(ret) for i in ret : print(i) # 普通条件语句 if 1 == 1: name = 'wupeiqi' else: name = 'alex' # 三元运算 name = 'wupeiqi' if 1 == 1 else 'alex'…
#!/usr/bin/env python #有如下值集合[11,22,33,44,55,66,77,88,99,90...],将所有大于66值保存至字典的一个key中,将小于66的值保存至大二个key的值 li = [11,22,33,44,55,66,77,88,99,90] person = {">66":[],"<=66":[]} for i,j in enumerate(li,0) : if int(j) > 66 : person[&q…