Skip to content

Instantly share code, notes, and snippets.

@killercup
Created November 4, 2009 18:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save killercup/226282 to your computer and use it in GitHub Desktop.
Save killercup/226282 to your computer and use it in GitHub Desktop.
def quer(zahl):
qsumme = 0
for einer in str(zahl):
qsumme = qsumme + int(einer)
if len(str(qsumme)) > 1:
qsumme = quer(qsumme)
return qsumme
zahl = 4242
quersumme = quer(zahl)
print "Die Quersumme von %i ist %i" % (int(zahl), int(quersumme))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment