2 Matching Annotations
  1. Jan 2015
    1. classes

      Word here should be 'functions'

    2. print d[t] # Prints "5" print d[(1, 2)] # Prints "1" prints "2"

      Those two lines are not what I expect - and my Python interpreter agrees. So perhaps that is a typo? I don't know Python well enough to guess the Levenshtein distance to what was intended here.

      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