Key + Value → Dict
Given two lists, one containing keys and the other containing values, create a dictionary by pairing corresponding elements from both lists.
The first line of the input contains a single integer
n
- the number of the elements in both lists.The second line of the input contains
n
space-separated elements of the first list (the keys), while the third line contains n
space-separated elements of the values.The program should print the resulting dictionary.
Input | Output |
3
name age city
Alice 25 Dallas | {'name': 'Alice', 'age': '25', 'city': 'Dallas'} |
2
fruit color
apple red | {'fruit': 'apple', 'color': 'red'} |
4
brand model year price
Toyota Camry 2020 24000 | {'brand': 'Toyota', 'model': 'Camry', 'year': '2020', 'price': '24000'} |
Constraints
Time limit: 2 seconds
Memory limit: 512 MB
Output limit: 1 MB