Popular recipes by Michael Puckett http://code.activestate.com/recipes/users/4176295/2011-01-14T00:29:05-08:00ActiveState Code RecipesPascal's triangle (Python)
2011-01-14T00:29:05-08:00Michael Pucketthttp://code.activestate.com/recipes/users/4176295/http://code.activestate.com/recipes/577542-pascals-triangle/
<p style="color: grey">
Python
recipe 577542
by <a href="/recipes/users/4176295/">Michael Puckett</a>
(<a href="/recipes/tags/pascal/">pascal</a>, <a href="/recipes/tags/triangle/">triangle</a>).
Revision 5.
</p>
<p>Pascal's triangle was a challenge on a forum I frequent today and this is what I came up with:</p>
Sublists (Python)
2010-12-21T16:28:20-08:00Michael Pucketthttp://code.activestate.com/recipes/users/4176295/http://code.activestate.com/recipes/577510-sublists/
<p style="color: grey">
Python
recipe 577510
by <a href="/recipes/users/4176295/">Michael Puckett</a>
(<a href="/recipes/tags/grouping/">grouping</a>, <a href="/recipes/tags/list/">list</a>, <a href="/recipes/tags/sublist/">sublist</a>).
</p>
<p>The opposite of list flattening. </p>
<p>Given a list and a length n return a list of sub lists of length n.</p>
Flattening lists (Python)
2010-12-21T16:04:38-08:00Michael Pucketthttp://code.activestate.com/recipes/users/4176295/http://code.activestate.com/recipes/577509-flattening-lists/
<p style="color: grey">
Python
recipe 577509
by <a href="/recipes/users/4176295/">Michael Puckett</a>
(<a href="/recipes/tags/flatten/">flatten</a>, <a href="/recipes/tags/list/">list</a>).
</p>
<p>Classic / frequently asked, <em>'How to flatten a list, regardless the nesting.'</em></p>