Python 内建函数 - next(iterable[, default])
2017-03-20 11:15
357 查看
Manual
直译
实例
拓展阅读
直译
实例
拓展阅读
Manual
Retrieve the next item from the iterator by calling its __next__() method. If default is given, it is returned if the iterator is exhausted, otherwise StopIteration is raised.直译
通过调用迭代器的__next__()方法来检索它的下一项。如果给定default,当迭代尽时将返回这个值,否则引发StopIteration。实例
>>> a = [1, 2, 3, 4, 5] >>> a = iter([1, 2, 3, 4, 5]) >>> next(a) 1 >>> next(a) 2 >>> next(a) 3 ···
拓展阅读
iter()相关文章推荐
- Python 内建函数 - max(iterable, *[key, default])
- Python 内建函数 - min(iterable, *[, key, default])
- Python内置函数min(iterable, *[, key, default])
- python中的iter()函数与next()函数
- Python json序列化时default/object_hook指定函数处理
- Python标准库:内置函数max(iterable, *[, key, default])
- python next()函数
- python中的next()以及iter()函数
- python中字典处理函数get和setdefault的区别
- python函数回顾:next()
- Python内建函数(A) all(iterable) any(iterable)
- python之__iter__函数与__next__函数
- 迭代器(关键词:Python/iterator/iterable/__iter__/next)
- Python标准库:内置函数next(iterator[, default])
- Python标准库:内置函数max(iterable, *[, key, default])
- Python 函数 参数 形式 Default Argument Keyword Arguments Formal Arguments
- Python标准库:内置函数next(iterator[, default])
- Python 内建函数 - map(function, iterable, ...)
- Python标准库:内置函数next(iterator[, default])
- Python 内建函数 - all(iterable)