你可以把整数变成一个字符串,把它分割成每个数字,把个位数转换成整数,然后像这样对列表求和。 number = 83 sum_digits = sum(int(num) for num in ...
確定! 回上一頁