Extract records if Kth elements not in List of tuples #Shorts

preview_player
Показать описание
Given list of tuples, task is to extract all the tuples where Kth index elements are not present in argument list.
This is one way in which this task can be. In this, we shorten the argument list using set and then efficiently check for Kth index having any element from arg. list and append accordingly.

Example:
Input : test_list = [(5, 3), (7, 4)], arg_list = [3, 3, 3, 3], K = 1

Output : [(7, 4)]

Explanation : (5, 3) is removed as it has 3 at 1st index.

If you found the video valuable, please leave a like and subscribe ❤️ It helps the channel grow and helps me pumping out more such content.

#shorts #python3​​ #programming​​ #programmintips​ #pythontips​ #codingtips​ #coding
Рекомендации по теме