Advertisement
JkSoftware

Day 9 - Python Dictionaries

Nov 13th, 2021
820
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.23 KB | None | 0 0
  1. #Key  -  Value
  2. #Bug - An error in a program that prevents the program from running as expected
  3. #Function - a piece of code that you can easily call over and over again
  4. #Loop - the action of doing something over and over again
  5. programming_dictionary = {
  6.     "Bug": "An error in a program that prevents the program from running as expected",
  7.     "Function": "A piece of code that you can easily call over and over again"
  8. }
  9.  
  10. print(programming_dictionary)
  11. programming_dictionary = {}
  12. print(programming_dictionary)
  13. programming_dictionary["Loop"] = "The action of doing something over and over again"
  14. programming_dictionary["Bug"] = "An errr in a progrm that prents the progam from unning as pected"
  15. programming_dictionary["Function"] = "A piece of code that you can easily call over and over again"
  16. print(programming_dictionary)
  17.  
  18. programming_dictionary["Bug"] = "An error in a program that prevents the program from running as expected"
  19. print(programming_dictionary)
  20.  
  21. programming_dictionary["Comment"] = "When you put a '#' in front of a line it comments it out and the program wont run that line of code"
  22. print(programming_dictionary["Comment"])
  23.  
  24. for key in programming_dictionary:
  25.     print(key)
  26.     print(programming_dictionary[key])
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement