Created
January 25, 2022 14:12
-
-
Save kkroesch/218d4ef3fb4a6eea7b24a7e48e73200a to your computer and use it in GitHub Desktop.
Calculate digit sum
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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