Dictionary (hash)

  1. What is a dictionary
  2. When to use dictionaries
  3. Dictionary
  4. keys
  5. Loop over keys
  6. Loop over dictionary keys
  7. Loop using items
  8. values
  9. Not existing key
  10. Get key
  11. Does the key exist?
  12. Does the value exist?
  13. Delete key
  14. List of dictionaries
  15. Shared dictionary
  16. immutable collection: tuple as dictionary key
  17. immutable numbers: numbers as dictionary key
  18. Sort a dictionary
  19. Sort dictionary values
  20. Sort dictionary by value
  21. Sort dictionary keys by value (another example)
  22. Insertion Order is kept
  23. Change order of keys in dictionary - OrderedDict
  24. Set order of keys in dictionary - OrderedDict
  25. Various dictionary examples
  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)