Advertisement
JkSoftware

Day 13 - Debugging

Nov 22nd, 2021
996
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ############DEBUGGING#####################
  2.  
  3.  # Describe Problem
  4. # def my_function():
  5. #     for i in range(1, 21):
  6. #         if i == 20:
  7. #             print("You got it")
  8. # my_function()
  9.  
  10. # # Reproduce the Bug
  11. # from random import randint
  12. # dice_imgs = ["1", "2", "3", "4", "5", "6"]
  13. # dice_num = randint(0, 5)
  14. # print(dice_imgs[dice_num])
  15.  
  16. # Play Computer
  17. # year = int(input("What's your year of birth?"))
  18. # if year >= 1980 and year <= 1994:
  19. #     print("You are a millenial.")
  20. # elif year > 1994:
  21. #     print("You are a Gen Z.")
  22.  
  23. # # Fix the Errors
  24. # age = int(input("How old are you?"))
  25. # if age > 18:
  26. #     print(f"You can drive at age {age}.")
  27.  
  28. #Print is Your Friend
  29. # pages = 0
  30. # word_per_page = 0
  31. # pages = int(input("Number of pages: "))
  32. # word_per_page = int(input("Number of words per page: "))
  33. # total_words = pages * word_per_page
  34. # print(total_words)
  35.  
  36. #Use a Debugger
  37. def mutate(a_list):
  38.     b_list = []
  39.     for item in a_list:
  40.         new_item = item * 2
  41.         b_list.append(new_item)
  42.     print(b_list)
  43.  
  44. mutate([2,4,6,8,10,12])
Advertisement
Advertisement
Advertisement
RAW Paste Data Copied
Advertisement