DiYane

Even Numbers

Jul 2nd, 2023 (edited)
782
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.25 KB | Help | 0 0
  1. n = int(input())
  2.  
  3. all_even = True
  4.  
  5. for _ in range(n):
  6.     num = int(input())
  7.     if num % 2 != 0:
  8.         print(num, "is odd!")
  9.         exit()
  10.     else:
  11.         all_even = all_even and True
  12.  
  13. if all_even:
  14.     print("All numbers are even.")
  15.  
Advertisement
Add Comment
Please, Sign In to add comment