sibinasto

05. List Adv - 04. Even Nums - Lab

Feb 11th, 2021
139
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.39 KB | None | 0 0
  1. nums_as_string = input().split(", ")
  2. nums = [int(el) for el in nums_as_string]
  3. # nums_map = list(map(lambda el: int(el), nums_as_string))
  4. # nums_map_ref = list(map(int, nums_as_string))
  5.  
  6. filtered_nums = [index for index in range(len(nums)) if nums[index] % 2 == 0]
  7. # filtered_num_filter = list(map(lambda el: nums.index(el), list(filter(lambda el: el % 2 == 0, nums))))
  8. print(filtered_nums)
Advertisement
Add Comment
Please, Sign In to add comment