Files
acmp/programm1/data_types3.py
2025-12-05 11:48:13 +05:00

17 lines
385 B
Python

temp = input().strip()
def main(score: str):
if not score:
raise ValueError("Пустой ввод")
if not score.isdigit():
raise ValueError("Введены не цифры")
total: int = 0
for x in score:
total += int(x)
print(f"сумма цифр = {total}")
try:
main(temp)
except ValueError as e:
print(f"Ошибка: {e}")