Seite 1 von 1

Nach Fakultät iterativ und rekursiv...

Verfasst: Dienstag 11. November 2008, 22:26
von BlackVivi
Mit goto ^___^

Code: Alles auswählen

from goto import goto, label, comefrom
nr = 10
i = 1
end = 1
label .whl
i += 1; end *= i
if i != 10: 
    goto .whl
print end #Ausgabe 3268800
(Stil absichtlich schlechter als schlecht. Kein Produktivkot, negativbeispiel ^_^)

(Wobei diese Variante strenggenommen auch iterativ ist)