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

Espousing the virtues of Secular Humanism, Libertarianism, Free and Open Source Software, Linux, Ubuntu, CentOS, Terminal Multiplexing, Docker, Python, Flask, Django, MySQL, MongoDB and Git.

comments powered by Disqus