Advertisement
pacho_the_python

Untitled

Mar 4th, 2022
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.22 KB | None | 0 0
  1. value_items = [3, "stones", 5, "wood", 10, "gold", 7, "silver"]
  2.  
  3. result = {}
  4.  
  5. for i in range(0, len(value_items), 2):
  6.     item = value_items[i + 1]
  7.     value = value_items[i]
  8.  
  9.     result[item] = value
  10.  
  11. print(result)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement