python常用函数 I
Posted Small_office
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了python常用函数 I相关的知识,希望对你有一定的参考价值。
iter(iterable)
可以生成一个迭代器。
例子:
islice(iterator, int, int)
itertools的islice方法为迭代器生成器提供切片操作。
例子:
izip_longest(iterable, iterable)
itertools的izip_longest方法是,可以使zip以最长匹配方式输出,python3改为zip_longest。
例子:
isinstance(object, type)
用来判断对象类型,可以是自己已创建的对象类型。
例子:
以上是关于python常用函数 I的主要内容,如果未能解决你的问题,请参考以下文章