Python Advanced Topics
来源:互联网 发布:编程语言是什么样 编辑:程序博客网 时间:2024/06/10 18:45
some functions about dictionary
dictionary.items()dictionary.keys()dictionary.values()
- dictionary = {“hello”:0, “world”:1}
- dictionary.items()
- [(‘world’, 1), (‘hello’, 0)]
- dictionary.keys()
- [‘world’, ‘hello’]
- dictionary.values()
- [1, 0]
list comprehension and list slicing
list = [i for i in range(1, 11) if i % 2 == 0]list_slice = [1:11:1] #[index1:index2:stride length]list_reverse = [::-1]
lambdas
One of the more powerful aspects of Python is that it allows for a style of programming called functional programming, which means that you’re allowed to pass functions around just as if they were variables or values. Sometimes we take this for granted, but not all languages allow this!
anonymous function.
filter()
print filter(lambda x: x % 2 != 0, range(1, 11))
dukeyunz
0 0
- Advanced Topics in Python
- Python Advanced Topics
- Python 入门教程 15 ---- Advanced Topics in Python
- Advanced Socket Topics
- Qt Advanced Topics
- Advanced C++ Topics
- Advanced ShaderLab topics
- Advanced Topics In Database Research
- Chapter 19:Advanced Function Topics
- Advanced Topics In Database Research, Volume 5
- Advanced Topics in Global Information Management
- CS563 - ADVANCED TOPICS IN COMPUTER GRAPHICS: PRESENTATIONS
- Advanced Topics in Information Resources Management
- Advanced Topics in Data Mining Spring 2011
- Unity3D翻译——Advanced ShaderLab topics
- advanced topics(重要的话题)
- python系列之 RabbitMQ -- TOPICS
- 书评 -- Programming Microsoft ASP.NET 2.0 Application Advanced Topics
- Java transient关键字
- 第17周项目2-用指针玩字符串(③)-用数组名作形参
- 浅谈Spring事务隔离级别
- linux 高并发socket通信模型
- poj 1979 Red and Black 递归实现
- Python Advanced Topics
- 安全联盟倡议三权立法 首日10万网民支持
- Html颜色值转成UIColor[RGB值]
- 排序
- 17周 项目2.3 求字符串的长度 并返回 用指针做形参
- opencv学习-训练harr特征分类器
- ORA-02283: 无法变更启动序列号
- paip.c3p0 数据库连接池 NullPointerException 的解决...
- LS_COLORS的妙用