brewersfan1976

ch3-ex2.py

Jul 14th, 2015
184
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.26 KB | None | 0 0
  1. # prints all elements in a list that are also lists
  2.  
  3. list = ["a", "b", "c", "d", "e", "f", "g", "h", "i", ["a", "b", "c"], ["d", "e", "f"], ["g", "h", "i"]]
  4.  
  5. for x in list:
  6.     try:
  7.         if x[1] != None:
  8.            print x
  9.     except IndexError:
  10.         pass
Advertisement
Add Comment
Please, Sign In to add comment