marxes = ('Groucho', 'Chico', 'Harpo')
pythons = ('CHapman', 'Cleese', 'Gilliam', 'Jones', 'Palin')
stooges = ('Moe', 'Curly', 'Larry')
tuple_of_lists = marxes, pythons, stooges
tuple_of_lists
((‘Groucho’, ‘Chico’, ‘Harpo’), (‘CHapman’, ‘Cleese’, ‘Gilliam’, ‘Jones’, ‘Palin’), (‘Moe’, ‘Curly’, ‘Larry’))
list_of_lists = [marxes, pythons, stooges]
list_of_lists
[(‘Groucho’, ‘Chico’, ‘Harpo’), (‘CHapman’, ‘Cleese’, ‘Gilliam’, ‘Jones’, ‘Palin’), (‘Moe’, ‘Curly’, ‘Larry’)]
dict_of_lists = {'Marxes': marxes, 'Pythons': pythons, 'Stooges': stooges}
dict_of_lists
{‘Marxes’: (‘Groucho’, ‘Chico’, ‘Harpo’), ‘Pythons’: (‘CHapman’, ‘Cleese’, ‘Gilliam’, ‘Jones’, ‘Palin’), ‘Stooges’: (‘Moe’, ‘Curly’, ‘Larry’)}
houses = {
(44.79, -93.14, 285): 'My House',
(38.89, -77.03, 13): 'The White House',
}
houses
{(38.89, -77.03, 13): ‘The White House’, (44.79, -93.14, 285): ‘My House’}
딕셔너리의 키는 불변이기 떄문에, 리스트,딕셔너리,셋은 다른 딕셔너리의 키가 될수 없다. 하지만 튜플은 될 수 있다.
Comments