More fun exercises with Python

break a list into 'n' pieces horizontally...

thelist = range(10)  
partition_horizontal(thelist, 3)  


[[1, 2, 3],
 [4, 5, 6],
 [7, 8, 9],

Craig Derington

Full Stack Developer. Linux, Docker, Python, Celery, Flask, Django, Go, MySQL, MongoDB and Git. Modern, secure, high-performance applications capable of processing millions of transactions a day.

comments powered by Disqus