If you only have a single key names 1
in the dict you can simply use
dict = {1:{("Apple",1),("Orange",1),("Banana",1),("Lemon",1)}}
{key for key, val in dict[1]} # used the 1 assuming its the only key
Output:
{"Apple","Orange","Banana","Lemon"}
Edit:
Code with any number of variables(keys)
dict = {1:{("Apple",1),("Orange",1),("Banana",1),("Lemon",1)},2:{("Apple",1),("Orange",1),("Banana",1),("Lemon",1)}}
resultArray = [{x for x, y in dict[eachkey]} for eachkey in {x for x, y in dict.items()} ]
print(resultArray)
Output:
[{'Orange', 'Apple', 'Lemon', 'Banana'}, {'Orange', 'Apple', 'Lemon', 'Banana'}]
Edit 2:
Code :
from itertools import chain
dict = {1:{("Apple",1),("Orange",1),("Banana",1),("Lemon",1)},2:{("Juice",1),("Cocktail",1),("Milk",1),("Soup",1)}}
resultArray = [{x for x, y in dict[eachkey]} for eachkey in {x for x, y in dict.items()} ]
print(set().union(*(resultArray)))
Output:
{'Lemon', 'Soup', 'Milk', 'Cocktail', 'Banana', 'Apple', 'Orange', 'Juice'}