From 6fc5d24d47f94477e5531c9f3304aa412fbd52bf Mon Sep 17 00:00:00 2001 From: zhang Date: Fri, 24 Jun 2022 21:48:06 +0800 Subject: [PATCH 1/2] text --- .../text.py" | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 "\347\273\203\344\271\240\347\224\250/text.py" 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..ac7ae8a82 --- /dev/null +++ "b/\347\273\203\344\271\240\347\224\250/text.py" @@ -0,0 +1,20 @@ +''' +Author: error: git config user.name && git config user.email & please set dead value or install git +Date: 2022-06-24 21:35:17 +LastEditors: error: git config user.name && git config user.email & please set dead value or install git +LastEditTime: 2022-06-24 21:35:18 +FilePath: /Python-100-Days/练习用/text.py +Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE +''' +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 From 52d775cf69439ebd4987fe80436029d80ef6dd39 Mon Sep 17 00:00:00 2001 From: zhang Date: Fri, 24 Jun 2022 21:52:51 +0800 Subject: [PATCH 2/2] 1.1 --- .../text.py" | 32 ++++++++----------- 1 file changed, 13 insertions(+), 19 deletions(-) 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" index ac7ae8a82..783e3a829 100644 --- "a/\347\273\203\344\271\240\347\224\250/text.py" +++ "b/\347\273\203\344\271\240\347\224\250/text.py" @@ -1,20 +1,14 @@ -''' -Author: error: git config user.name && git config user.email & please set dead value or install git -Date: 2022-06-24 21:35:17 -LastEditors: error: git config user.name && git config user.email & please set dead value or install git -LastEditTime: 2022-06-24 21:35:18 -FilePath: /Python-100-Days/练习用/text.py -Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE -''' +#-*- 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 +'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