Quiz Catalog

Catalog of quizzes

d = {
  -1: "some"
}

print(d[-1])
some
  • dict/indexing

dict1 = {
  0: "False",
  True: "1"
}

print(dict1[1], dict1[False])
1 False
  • dict/indexing

elements = {1: 2, 2: 3, 3: 4}
elements[2] += 6

print(elements.items())
dict_items([(1, 2), (2, 9), (3, 4)])
  • dict/operation/item
  • dict/indexing

x = {1: 'a', 2: 'b'}
y = {2: 'c', 3: 'd'}

print({**x, **y}[2])
c
  • dict/indexing
  • dict/var-keyword