Next Hash Hash Hash 10
  • Basic idea:

  • Arrays allow lookup of data using a numeric index:

                 i = 23
                 a[i] = "Margaret Hamilton"
                 
                 print a[23]              # Prints "Margaret Hamilton"
  • Hashes allow lookup of data using a string index:

                 s = "Hamilton"
                 a[s] = "Margaret"
                 
                 print a["Hamilton"]       # Prints "Margaret"

Next 10