Python - Accessing K element in set without deletion
In this article given a set(), the task is to write a Python program to access an element K, without performing deletion using pop(). Example: Input : test_set = {6, 4, 2, 7, 9}, K = 7 Output : 3 Explanation : 7 occurs in 3rd index in set. Input : test_set = {6, 4, 2, 7, 9}, K = 9 Output : 4 Explana