I got a problem:
keys here is a list.
keys = [(6,4) , (6,8)]
The entries in the keys can be 4,5...or watever
Now, I have to pick up only 1 from it.So I used:
root = keys[0]
print root
output: (6,4)
Now I have to make a set which is empty, say,...
closed = set()
for u,v of root:
if v not in closed:
closed.add(v)
for val in closed:
print val
It should add values to the set i.e 6 and 4. How should I implement it? The above method is right or wrong? I tried, but not giving me the right ans