Created
December 6, 2011 10:45
-
-
Save thinkphp/1437749 to your computer and use it in GitHub Desktop.
merge-demo.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ''' | |
| Merging two arrays or three..or four..or five..or ...n :P | |
| by Adrian Statescu <adrian@thinkphp.ro> | |
| MIT Style License | |
| ''' | |
| import merge | |
| l = ([2,4,6,8],[1,3,5,7,9],[11,12,13,14,15,16,17]) | |
| i = 1; | |
| ll = l[0] | |
| while i<len(l): | |
| ll = merge.merge(ll,l[i]) | |
| i +=1 | |
| print ll |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment