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)
相关文章推荐
- Lecture 7_2: Lists and mutability, dictionaries, pseudocode, introduction to efficiency
- 6.00 Introduction to Computer Science and Programming Lec 9: Lecture 9: Memory and Search Methods
- 6.00 Introduction to Computer Science and Programming Lec 9: Lecture 9: Memory and Search Methods
- Lecture 4: Decomposition and abstraction through functions; introduction to recursion
- Lecture 6: Bisection methods, Newton/Raphson, introduction to lists
- 斯坦福大学iOS应用开发教程学习笔记(第一课)MVC.and.Introduction.to.Objective-C
- Introduction to Constructors and Destructors in VB.NET
- [中英对照]Introduction to DPDK: Architecture and Principles | DPDK概论: 体系结构与实现原理
- Lecture 1&2 - Introduction to Computation
- Introduction to Monoids and Semigroups with Spark
- Website for the introduction to Matlab and Java
- Introduction to Algorithm - lecture 1
- 介绍Flex4当中的视窗和滚动(Introduction to viewports and scrolling in Flex 4)
- Game Sound: An Introduction to the History, Theory, and Practice of Video Game Music and Sound Desig
- Introduction to The Design and Analysis of Algorithms (1)
- iPhone in Action: Introduction to Web and SDK
- Introduction to Face Detection and Face Recognition
- 【推荐系统论文笔记】Introduction To Recommender Systems: Algorithms and Evaluation
- Probability and Statistics -- Introduction to Probability (part I)
- lists and Dictionaries