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