n = int(input()) suma = 0 mult = 1 while n > 0: digit = n % 10 suma = suma + digit mult = mult * digit n = n // 10 print("Сумма:", suma) print("Произведение:", mult)
def total(a, b):
amount = 0
for i in range(a, b+1):
amount += i
return amount
x, y = map(int, input().split(" "))
print(total(x, y))
Объяснение: