Advertisement
FelipeNeto2

Dicionários(Python)

Dec 11th, 2019
164
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.36 KB | None | 0 0
  1. songs = ["Like a Rolling Stone", "Satisfaction", "Imagine", "What's Going On", "Respect", "Good Vibrations"]
  2. playcounts = [78, 29, 44, 21, 89, 5]
  3.  
  4. plays = {songs:playcounts for songs, playcounts in zip(songs, playcounts)}
  5.  
  6. print(plays)
  7.  
  8. plays["Purple Haze"] = 1
  9. plays["Respect"] = 94
  10.  
  11. library = {"The Best Songs": plays, "Sunday Feelings": {}}
  12.  
  13. print(library)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement