diff --git "a/\347\273\203\344\271\240\347\224\250/text.py" "b/\347\273\203\344\271\240\347\224\250/text.py" new file mode 100644 index 000000000..783e3a829 --- /dev/null +++ "b/\347\273\203\344\271\240\347\224\250/text.py" @@ -0,0 +1,14 @@ +#-*- coding: UTF-8 -*- + +prices = { +'AAPL': 191.88, +'GOOG': 1186.96, +'IBM': 149.24, +'ORCL': 48.44, +'ACN': 166.89, +'FB': 208.09, +'SYMC': 21.29 +} +# 用股票价格大于100元的股票构造一个新的字典 +prices2 = {key: value for key, value in prices.items() if value > 100} +print(prices2) \ No newline at end of file