Skip to content

Instantly share code, notes, and snippets.

@kkroesch
Created January 25, 2022 14:12
Show Gist options
  • Select an option

  • Save kkroesch/218d4ef3fb4a6eea7b24a7e48e73200a to your computer and use it in GitHub Desktop.

Select an option

Save kkroesch/218d4ef3fb4a6eea7b24a7e48e73200a to your computer and use it in GitHub Desktop.
Calculate digit sum
def qs(k : int) -> int:
s = 0
while k:
s = s + k % 10
k = k // 10
return s
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment