Guest User

Untitled

a guest
Nov 22nd, 2013
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import cPickle, urllib2,re
  2.  
  3.  
  4. banner = []
  5.  
  6. def unpickle(urltoopen):
  7.         data = urllib2.urlopen(urltoopen).read()
  8.         stream = cPickle.loads(data)
  9.         return stream
  10.  
  11. list1 = unpickle("http://www.pythonchallenge.com/pc/def/banner.p")  #produces a tuple within a list within a list
  12.  
  13. for i,m in enumerate(list1):
  14.         for j,n in enumerate(list1[i]):
  15.                 banner[i] = list1[i][j][0]
  16.  
  17.  
  18.  
  19.  
  20. print banner
  21.  
  22.  
  23. """
  24. Traceback (most recent call last):
  25.  File "python5.py", line 15, in <module>
  26.    banner[i].append(list1[i][j][0])
  27. IndexError: list index out of range
  28. """
Advertisement
Add Comment
Please, Sign In to add comment