您的位置:首页 > 其它

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

2017-09-25 00:17 459 查看
# example code, Lecture 7, Fall 2008

def 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)
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  MIT