[Tutor] Recursion
Daniel Yoo
dyoo@hkn.eecs.berkeley.edu
Wed, 6 Jun 2001 02:41:30 -0700 (PDT)
On Wed, 6 Jun 2001, Daniel Yoo wrote:
> ###
> def two_at_a_time(L):
> source = one_at_a_time(L)
> c = []
> for x in L:
> for s in source:
> c.append([x] + s)
> ###
Oops. Ok, I need to make a correction of a very silly bug:
###
def two_at_a_time(L):
source = one_at_a_time(L)
c = []
for x in L:
for s in source:
c.append([x] + s)
return c
###
The program I wrote did all this neat work, but it never gave the answer
back to us! Ugh. Same bug with three_at_a_time(). Sorry about that.