Advertisement
maurobaraldi

Teaching python lists

Aug 19th, 2014
244
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.49 KB | None | 0 0
  1. In [1]: notas = [1,2,3,4,5]
  2.  
  3. In [2]: len(notas)
  4. Out[2]: 5
  5.  
  6. In [3]: notas[0]
  7. Out[3]: 1
  8.  
  9. In [4]: notas[1]
  10. Out[4]: 2
  11.  
  12. In [5]: notas[2]
  13. Out[5]: 3
  14.  
  15. In [6]: notas[3]
  16. Out[6]: 4
  17.  
  18. In [7]: notas[4]
  19. Out[7]: 5
  20.  
  21. In [8]: notas[5]
  22. ---------------------------------------------------------------------------
  23. IndexError                                Traceback (most recent call last)
  24. /home/mauro/projects/panera/mwapp/<ipython-input-8-fd66b449eadb> in <module>()
  25. ----> 1 notas[5]
  26.  
  27. IndexError: list index out of range
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement