Python tuple untuk dikte
>>> t = ((1, 'a'),(2, 'b'))
>>> dict((y, x) for x, y in t)
{'a': 1, 'b': 2}
The Biton
>>> t = ((1, 'a'),(2, 'b'))
>>> dict((y, x) for x, y in t)
{'a': 1, 'b': 2}
dict = { 'Geeks': 10, 'for': 12, 'Geek': 31 }
# Converting into list of tuple
list = [(k, v) for k, v in dict.items()]