Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Aug 11th, 2012  |  syntax: None  |  size: 0.33 KB  |  hits: 7  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. def recurse (list1, list2 = [], list3 = [2,4,6]):
  2.                 if len(list1) == 0:
  3.                         print list2 * 3
  4.                         return
  5.                 el = 0
  6.                 t = 0
  7.                 for i in range(len(list1)):
  8.                         list2.append(list1.pop(i) * list3 [el] + i)
  9.                         el = (el + 1) % len(list3)
  10.                         t = t + recurse(list1,list2)
  11.                         list1.insert(i, list2.pop())
  12.                 return t
  13. recurse([3,5],[2,1,3])