Intern — Middle
Swapping keys and values in a dictionary
livecode
Task condition
Given a dictionary. Implement a program that creates a new dictionary by swapping its keys and corresponding values.
Example 1: Input: {"a": 1, "b": 2, "c": 3} Output: {1: "a", 2: "b", 3: "c"}
Example 2: Input: {"x": "hello", "y": "world"} Output: {"hello": "x", "world": "y"}