9. Write a python program to combine two lists into a Python dictionary, list_a and list_b as a Python list showed in the following output.
The output is:
list_a = [1, 2, 3, 4, 5, 6]
list_b = ['Python', 'Is', 'Programming', 'Language', 'the', 'most']
Expected Answer:
{1: 'Python', 2: 'Is', 3: 'Programming', 4: 'Language', 5: 'the', 6: 'most'}
Sample Answer:
list_a = [1, 2, 3, 4, 5, 6] list_b = ['Python', 'Is', 'Programming', 'Language', 'the', 'most'] new_dictionary = dict(zip(list_a, list_b)) print(new_dictionary)
More Exercises:
Python String ExercisesMore Numpy Exercises:
Numpy String ExercisesMore Pandas Exercises:
Pandas Series ExercisesMore Tutorials:
Python Installation - Linux (Ubuntu)