This commit is contained in:
Facetomyself 2025-03-29 18:39:44 -05:00 committed by GitHub
commit 0a4b41ebb4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 14 additions and 0 deletions

14
练习用/text.py Normal file
View File

@ -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)