class Solution:
    def addDigits(self, num):
        """
        :type num: int
        :rtype: int
        """
        total = num
        while len(str(total)) != 1:
            total = 0
            for d in str(num):
                total += int(d)
            num = total
            # print(total)
        return total
83381d21c88c343acec62199257b199afe8ea212
<mask token>

class Solution:
    <mask token>

class Solution:

    def addDigits(self, num):
        """
        :type num: int
        :rtype: int
        """
        total = num
        while len(str(total)) != 1:
            total = 0
            for d in str(num):
                total += int(d)
            num = total
        return total

class Solution:
    def addDigits(self, num):
        """
        :type num: int
        :rtype: int
        """
        total = num
        while len(str(total)) != 1:
            total = 0
            for d in str(num):
                total += int(d)
            num = total
            # print(total)
        return total