Q:

Reverse Dictionary mapping using python programming

0

Reverse Dictionary mapping

Given:

ascii_dict = {'A': 65, 'B': 66, 'C': 67, 'D': 68}

Expected Output:

{65: 'A', 66: 'B', 67: 'C', 68: 'D'}

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

Solution:

ascii_dict = {'A': 65, 'B': 66, 'C': 67, 'D': 68}
# Reverse mapping
new_dict = {value: key for key, value in ascii_dict.items()}
print(new_dict)

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

This question belongs to these collections

Similar questions


need a help?


find thousands of online teachers now