a = list(input('Введите число: '))
b = len(a)
for i in a:
if int(i) % 2 != 0: b -= 1
if b == len(a): print('Да')
else: print('Нет')
import typing
from typing import Any
from typing import AnyStr
from typing import Callable
def NumericStringScan(NumString: AnyStr, predicate: Callable[[int], bool]):
for digit in NumString:
if not predicate(int(digit)): return False
return True
def main():
NumString = input('Enter number to analyse:\n')
IsAllDigitEven = NumericStringScan(NumString, lambda d: d % 2 == 0)
print('Да' if (IsAllDigitEven) else 'Нет')
if __name__ == "__main__":
main()
a = list(input('Введите число: '))
b = len(a)
for i in a:
if int(i) % 2 != 0: b -= 1
if b == len(a): print('Да')
else: print('Нет')
import typing
from typing import Any
from typing import AnyStr
from typing import Callable
def NumericStringScan(NumString: AnyStr, predicate: Callable[[int], bool]):
for digit in NumString:
if not predicate(int(digit)): return False
return True
def main():
NumString = input('Enter number to analyse:\n')
IsAllDigitEven = NumericStringScan(NumString, lambda d: d % 2 == 0)
print('Да' if (IsAllDigitEven) else 'Нет')
if __name__ == "__main__":
main()