Advertisement
T-D-K

Untitled

Jun 29th, 2018
303
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.20 KB | None | 0 0
  1. a = [9, 1, 2, 3, 4, 5]
  2. r = -1
  3. for i in a:
  4.     if i % 2 == 0 and (r == -1 or r < i):
  5.         r = i
  6. if r == -1:
  7.     print("В массиве нет чётных чисел")
  8. else:
  9.     print(r)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement