python_math_stat/practica/stepik/stepik_tasks/counting_numbers.py
2023-10-04 16:07:27 +03:00

10 lines
301 B
Python
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# программа, кот считывает числа с ввода и после первого введенного нуля выводит сумму полученных чисел
a= input().split()
Sum = 0
for num in a:
if num == 0:
break
Sum = Sum + int(num)
print (Sum)