Modify this given Python code to handle inputs of any size
def sum_digits(num):
    total = 0
    while num > 0:
        total += num % 10
        num //= 10
    return total
def sum_digits(num):
    total = 0
    while num != 0:
        total += num % 10
        num //= 10
    return total