Advertisement
michael_xgrind

Untitled

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