[Python] python字典基本操作范例代码 →→→→→进入此内容的聊天室

来自 , 2021-01-15, 写在 Python, 查看 120 次.
URL http://www.code666.cn/view/fc1a3682
  1. d2 = {'spam': 2, 'ham': 1, 'eggs': 3}    # make a dictionary
  2.  
  3. print d2                                       # order is scrambled
  4.  
  5. d2['ham'] = ['grill', 'bake', 'fry']      # change entry
  6.  
  7. del d2['eggs']                            # delete entry
  8.  
  9. d2['brunch'] = 'Bacon'                    # add new entry
  10.  
  11. print d2
  12.  
  13. #//python/4568

回复 "python字典基本操作范例代码"

这儿你可以回复上面这条便签

captcha