# Python Shorts — Digits Sum

4 min readFeb 22, 2023

There’s one algorithm that’s 25 times faster!

Every once in a while, I come across some discussion involving number games or other interesting math, where the sum of all the digits in an integer is to be found repeatedly until only one digit is left. I decided to write a short Python function to do this calculation, so I could add it to my bag of Python tricks.