markdown python,exercise,iterator

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了markdown python,exercise,iterator相关的知识,希望对你有一定的参考价值。

when use python in the way below, there will be an exception: 
```
In [19]: it = iter([1,2,3])
In [20]: it.next()

---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
<ipython-input-20-24d6ab57088b> in <module>()
----> 1 it.next()

AttributeError: 'list_iterator' object has no attribute 'next'
```
this is a syntax change between python2 and python3. in 3 you can use next(it) instead.

以上是关于markdown python,exercise,iterator的主要内容,如果未能解决你的问题,请参考以下文章

46 Simple Python Exercises 16-22题

46 Simple Python Exercises (前20道题)

Python全栈工程师 (exercises)

Python基础lpthw - Exercise 40 模块类和对象

46 Simple Python Exercises-Higher order functions and list comprehensions

Data Analysis with Python : Exercise- Titantic Survivor Analysis | packtpub.com