a = input()
total = 0
for i in a:
total += int(i)
print(total)
Объяснение:
n = int(input())
p = 1
while n > 0:
p *= n % 10
n //= 10
print(p)
a = input()
total = 0
for i in a:
total += int(i)
print(total)
Объяснение:
n = int(input())
p = 1
while n > 0:
p *= n % 10
n //= 10
print(p)