Требуется программа, суммирующая все числа кратные 4 и оканчивающиеся на 8, 0 является концом списка чисел
Написал это: i = 1 s = 0 c = int(1) while i != 0: c = input(int()) if c != 0 and c % 4 == 0 and (c/10) % 1 == 8: s = s + c else: i = 0 print(s)
Выдает это: Traceback (most recent call last): File "C:\Users\Admin\PycharmProjects\pythonProject\main.py", line 6, in if c != 0 and c % 4 == 0 and (c/10) % 1 == 8: TypeError: not all arguments converted during string formatting
Написал это:
i = 1
s = 0
c = int(1)
while i != 0:
c = input(int())
if c != 0 and c % 4 == 0 and (c/10) % 1 == 8:
s = s + c
else:
i = 0
print(s)
Выдает это:
Traceback (most recent call last):
File "C:\Users\Admin\PycharmProjects\pythonProject\main.py", line 6, in
if c != 0 and c % 4 == 0 and (c/10) % 1 == 8:
TypeError: not all arguments converted during string formatting