Python puzzle sets
<p>I found this table in How to Think Like a Computer Scientist: Learning with Python.</p>

<pre><code>1
2       4
3       6       9
4       8       12      16
5       10      15      20      25
6       12      18      24      30      36
7       14      21      28      35      42      49
</code></pre>

<p>The exercise was to create a program which produces that output. I must have spent at least an hour on it, and I came up with this:</p>

<pre><code>def printMultiples(n):
 g = n*n
 m = n
 while m &lt; g:
  if m%n == 0:
   print m, '\t',
   m = m+1
  elif m%n != 0:
   m = m+1
 print g

def uniqueTable(n, y):
 while n &lt; y:
  printMultiples(n)
  n = n+1
 printMultiples(y)

uniqueTable(1, 7)
</code></pre>

<p>And it worked! I was so happy, I almost cried. Anyways, I've become addicted to these sorts of Python problems; currently I'm working on a program that prints the Fibonacci sequence. I go looking for problems, but they always go way over my head for some reason, for example the Facebook puzzles which use ASCII which I haven't studied yet. Does anyone know of any good Python problem sets?</p>
