| Python 2.2 für Einsteiger | ||
|---|---|---|
| <<< Previous | Einführung anhand von Beispielen | Next >>> |
#!/usr/bin/python
def perm(source, done=0, current=[]):
if done == len(source):
if current[0] < current[-1]:
print current
else:
for i in source:
if i not in current:
perm(source, done+1, current+[i])
d = [1,2,3,4]
perm(d)
| <<< Previous | Home | Next >>> |
| ZIP - Mischen von Listen | Up | Teilbarkeiten |