even = 0 odd = 0 for i in range(1, 11): n = eval(input()) if n % 2 == 0: even += 1 else: odd += 1 print('Even numbers:', even) print('Odd numbers:', odd)
Category: Python
全新的繁體中文 WordPress 網站
even = 0 odd = 0 for i in range(1, 11): n = eval(input()) if n % 2 == 0: even += 1 else: odd += 1 print('Even numbers:', even) print('Odd numbers:', odd)