Commit e5d2e9da by BellCodeEditor

save project

parent 502609b5
Showing with 34 additions and 0 deletions
dict={'888点券':90,'ipad':2000000000,'苹果':40,'银行':9000000000,'可口可乐':45,'乐事':9,'农失山泉':2,'大白免':1,'粤利粤':6,'雷碧':3,'喜之娘':15,'啊萨姆':4}
k=input('What would you buy?')
if k in dict:
print('Good~your'+k+'must cost'+str(dict[k])+'yuan~')
else:
print('Sorry,it is not in.Please waite some times~')
\ No newline at end of file
cost={'apple':3.14,'pear':6.28,'peach':9.42,'coke':12.56,'fish':15.7,'candy':18.84}
k=input('Please print fruit name:')
v=input('Please print fruit')
if k in cost:
if float(v)<cost[k]:
cost[k]=float(v)
print(k+'jjl,xj'+v+'y')
else:
print(k+'zzl,usnobuy')
else:
cost[k]=float(v)
print(k+'djq'+v+'yysc')
\ No newline at end of file
dict_wc={'a':9,'b':25,'c':15,'d':45,'e':12}
print(dict_wc)
print(dict_wc['d'])
dict_wc['a']=250
print(dict_wc)
dict_wc['s']=518
print(dict_wc)
\ No newline at end of file
# 直接运行以下代码,说说你的发现:
list_hero=['赵一',30,'丁二',37,'孙五',52,'王猛',89,'周亮',98]
dict_hero = {'赵一':30,'丁二':37,'孙五':52,'王猛':89,'周亮':98}
print(len(list_hero))
print(len(dict_hero))
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment