Advertisement
myloyo

Задание 1.8 Функции

Nov 4th, 2024
47
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.29 KB | None | 0 0
  1. def erase_odd(arr):
  2.     min_elem = min(arr)
  3.     min_index = arr.index(min_elem)
  4.     for i in range(len(arr) - 1, min_index, -1):
  5.         if arr[i] % 2 == 1:
  6.             del arr[i]
  7.  
  8. n = int(input())
  9. arr = [int(x) for x in input().split()]
  10. erase_odd(arr)
  11. print(' '.join(map(str, arr)))
  12.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement