Advertisement
rex9840

Untitled

Nov 28th, 2024 (edited)
32
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.70 KB | None | 0 0
  1. ####################################################
  2. # Written by: Sean Huff
  3. # CS1002: Indroduction to Computer Science
  4. # Date:
  5. # Assignment 3: Lab 6-2
  6. # Description: Broken Code
  7. ####################################################
  8. # DICTIONARY
  9. stats = {1: {"Player": "Derrick Henry", "yards": 870, "TD": 9}, 2: {"Player": "Nick Chubb", "Yards": 841, "TD": 10}, 3: {"Player": "Saquon Barkley", "Yards": 779,
  10. "TD": 5}}
  11. x=3
  12. zz=0
  13. # LOOP
  14. while zz != -7:
  15. # NESTED LOOP
  16.     for key,value in stats.items():
  17.         for x, y in value.items():    
  18.             print("Player ={}".format(y))
  19. # IF YARDS
  20.             if x.lower() == "yards":
  21.                 print("yards = {}".format(y))
  22.                 zz = -7
  23.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement