промежутое
This commit is contained in:
16
programm1/data_types3.py
Normal file
16
programm1/data_types3.py
Normal file
@@ -0,0 +1,16 @@
|
||||
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}")
|
||||
Reference in New Issue
Block a user