Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # prints all elements in a list that are also lists
- list = ["a", "b", "c", "d", "e", "f", "g", "h", "i", ["a", "b", "c"], ["d", "e", "f"], ["g", "h", "i"]]
- for x in list:
- try:
- if x[1] != None:
- print x
- except IndexError:
- pass
Advertisement
Add Comment
Please, Sign In to add comment