Short Python while loop
\nclass Solution:\n    def digitSum(self, s: str, k: int) -> str:\n        \n        while len(s) > k:\n            curr = []\n            for i in range(0, len
```\nclass Solution:\n    def digitSum(self, s: str, k: int) -> str:\n        \n        while len(s) > k:\n            curr = []\n            for i in range(0, len(s), k):\n                curr.append(str(sum(int(s[j]) for j in range(i, min(len(s),i+k)))))\n            s = \'\'.join(curr)\n            \n        return s\n```\n\n\nslightly update version :\n\n```\nclass Solution:\n    def digitSum(self, s: str, k: int) -> str:\n        \n        while len(s) > k:\n            curr = \'\'\n            for i in range(0, len(s), k):\n                curr+=str(sum(int(s[j]) for j in range(i, min(len(s),i+k))))\n            s = curr\n            \n        return s\n```
['Python']