Advertisement
Fhernd

recorrer-lista.py

Jan 21st, 2018
1,126
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.18 KB | None | 0 0
  1. primos = [2, 3, 5]
  2.  
  3. # Obtención de iterador:
  4. iterador = iter(primos)
  5.  
  6. print(next(iterador))
  7. print(next(iterador))
  8. print(next(iterador))
  9.  
  10. # Se genera error:
  11. print(next(iterador))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement