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. Exercise: count characters
  26. Exercise: count words
  27. Exercise: count words from a file
  28. Exercise: Apache log
  29. Exercise: Combine lists again
  30. Exercise: counting DNA bases
  31. Exercise: Count Amino Acids
  32. Exercise: List of dictionaries
  33. Exercise: Dictionary of dictionaries
  34. Exercise: Age limit with dictionaries
  35. Solution: count characters
  36. Default Dict
  37. Solution: count characters with default dict
  38. Solution: count words (plain)
  39. Solution: count words (defaultdict)
  40. Solution: count words (Counter)
  41. Solution: count words in file
  42. Solution: Apache log
  43. Solution: Apache log using split
  44. Solution: Combine files
  45. Solution: Combine files-improved
  46. Solution: counting DNA bases
  47. Solution: Count Amino Acids
  48. Solution: List of dictionaries
  49. Solution: Dictionary of dictionaries
  50. Solution: Age limit with dictionaries
  51. Do not change dictionary in loop