prices ={ "aaa":166, "bbb":56, "cdfsa":133, "fs":22, "Sy":233.34 } #生成式(推导式)的用法
# 用股票价格大于100元的股票构造一个新的字典
prices2 ={ key :value for key,value in prices.items() if value >100 } print(prices2)
标签:推导,python,value,prices2,用法,字典 From: https://www.cnblogs.com/kevin-yang123/p/17027220.html