Lecture 7_1: Lists and mutability, dictionaries, pseudocode, introduction to efficiency

来源:互联网 发布:阿里云cdn加速如何使用 编辑:程序博客网 时间:2024/05/17 01:56
# example code, Lecture 7, Fall 2008def showDicts():    EtoF = {'one': 'un', 'soccer': 'football', 'never': 'janaie'}    print (EtoF['soccer'])    input()#    print (EtoF[0])    #Dictionary is not order.    print (EtoF)    input()    NtoS = {1: 'one', 2:'two', 'one':1, 'two':2 }    print (NtoS)    print (NtoS.keys())    input()    print (NtoS.keys)    input()    del NtoS['one']    print (NtoS)    input()def Dicts():    dic = {'a':1, 'b':2}    print (dic)    print (dic['a'])    list1 = dic.keys()    print (list1)    list2 = dic.values()    print (list2)    

阅读全文
0 0
原创粉丝点击