Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- old_dict = {"Pavel":1, "Iulian":2, "Timur":3}
- new_dict = dict([(value, key) for key, value in old_dict.items()])
- print ("Original dictionary is : ")
- print(old_dict)
- print()
- print ("Dictionary after swapping is : ")
- print("keys: values")
- for i in new_dict:
- print(i, " : ", new_dict[i])
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement