Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- [xgrind@localhost Área de trabalho]$ python
- Python 2.7.6 (default, Jun 28 2014, 19:27:51)
- [GCC 4.8.2] on linux2
- Type "help", "copyright", "credits" or "license" for more information.
- >>> n = [[1,2,3
- ... ], [4,5,6,7,8,9]]
- >>> def flatten(lists):
- ... results = []
- ... for numbers in range(len(lists)):
- ... results.append(lists[numbers])
- ... return results
- ...
- >>> print flatten(n)
- [[1, 2, 3], [4, 5, 6, 7, 8, 9]]
- >>>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement