python 知识点
来源:互联网 发布:java使用md5加密解密 编辑:程序博客网 时间:2024/05/16 09:47
【1】filter(function or None, iterable) --> filter object
filter(lambda x : x%2, [1,2,3,4,5]) --> [1,3,5]
【2】map(func, *iterables) --> map object
map(lambda x : x*2, range(5)) --> [0,2,4,6,8]
【3】dict初始化方式 3种
dict() -> new empty dictionary
| dict(mapping) -> new dictionary initialized from a mapping object's【4】issubclass(cls, class_or_tuple, /)
| (key, value) pairs
| dict(iterable) -> new dictionary initialized as if via:
| d = {}
| for k, v in iterable:
| d[k] = v
| dict(**kwargs) -> new dictionary initialized with the name=value pairs| in the keyword argument list. For example: dict(one=1, two=2)
Return whether 'cls' is a derived from another class or is the same class
【5】isinstance(obj, class_or_tuple, /)Return whether an object is an instance of a class or of a subclass thereof.注意:当第一个参数需传入对象实例,而不能传入class,否则结果都为false,第二个参数需传入类,否则会抛出异常。
阅读全文
0 0
- python知识点
- python 知识点
- Python知识点
- python知识点
- Python 知识点
- Python知识点
- Python知识点
- python知识点
- python 知识点
- Python知识点
- python--知识点
- Python 知识点
- Python知识点
- Python知识点
- Python多线程知识点
- python 的一些知识点
- python知识点讨论
- python知识点汇总
- 欧拉函数的一道练习题(附加容斥做法)
- Struts2中的拦截器
- python nonlocal关键字
- Python基础
- Python3[爬虫实战] 爬虫之scrapy爬取爱上程序网存MongoDB(android模块)
- python 知识点
- PostgreSQL插件开发踩坑之路1
- win32窗口程序-------3、位图及去除背景色
- (三)创建功能模块
- c_day05 联合体-枚举
- IoC之两种获得Bean容器的方法与区别
- 《effective c++》学习笔记(三)
- 获取iOS手机当前最上层的veiwcontroller
- java集合之ArrayList方法的使用实例