Commit d4813602 by BellCodeEditor

auto save

parent 068784c4
Showing with 8 additions and 5 deletions
dic_hero = {'赵雄':0,'关羽':40,'刘备':50}
print('修改前:',dic_hero)
dic_hero['关羽'] = 100
print('修改后:',dic_hero)
print(dic_hero[0])
\ No newline at end of file
#增加键值对'张飞':60
dic_hero['张飞'] = 60
print(dic_hero)
#查找刘备是否在字典中,如果在,打印刘备的臂力值
if '刘备'in dic_hero:
print(dic_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