Dictionary (hash)

  1. What is a dictionary
  2. When to use dictionaries
  3. Various dictionary examples
  4. Dictionary
  5. keys
  6. Loop over keys
  7. Loop over dictionary keys
  8. Loop using items
  9. values
  10. Not existing key
  11. Get key
  12. Does the key exist?
  13. Does the value exist?
  14. Delete key
  15. List of dictionaries
  16. Shared dictionary
  17. immutable collection: tuple as dictionary key
  18. immutable numbers: numbers as dictionary key
  19. Sort a dictionary
  20. Sort dictionary values
  21. Sort dictionary by value
  22. Sort dictionary keys by value (another example)
  23. Insertion Order is kept
  24. Change order of keys in dictionary - OrderedDict
  25. Set order of keys in dictionary - OrderedDict
  26. Setdefault
  27. Exercise: count characters
  28. Exercise: count words
  29. Exercise: count words from a file
  30. Exercise: Apache log
  31. Exercise: Combine lists again
  32. Exercise: counting DNA bases
  33. Exercise: Count Amino Acids
  34. Exercise: List of dictionaries
  35. Exercise: Dictionary of dictionaries
  36. Exercise: Age limit with dictionaries
  37. Exercise: Merge files with timestamps
  38. Solution: count characters
  39. Default Dict
  40. Solution: count characters with default dict
  41. Solution: count words (plain)
  42. Solution: count words (defaultdict)
  43. Solution: count words (Counter)
  44. Solution: count words in file
  45. Solution: Apache log
  46. Solution: Apache log using split
  47. Solution: Combine files
  48. Solution: Combine files-improved
  49. Solution: counting DNA bases
  50. Solution: Count Amino Acids
  51. Solution: List of dictionaries
  52. Solution: Dictionary of dictionaries
  53. Solution: Age limit with dictionaries
  54. Solution: Merge files with timestamps
  55. Do not change dictionary in loop
  56. Named tuple (sort of immutable dictionary)
  57. Create dictionary from List
  58. Sort Hungarian letters (lookup table)