classes
Word here should be 'functions'
classes
Word here should be 'functions'
print d[t] # Prints "5" print d[(1, 2)] # Prints "1" prints "2"
Aha - it's further down - we just need to stick in this initializer first:
d = {(x, x + 1): x for x in range(10)} # Create a dictionary with tuple keys