P-Assignment 13: Dictionaries
Hi,
- Write a “Python” script to store ‘4’ key-value pairs in to a dictionary.
- Write a “Python” script to read ‘4’ key-value pairs from the user and store it in to the dictionary.
- Write a “Python” script to sort the dictionary on the basis of keys.
- Write a “Python” script to sort the dictionary on the basis of values of the corresponding keys.
- Write a “Python” script to read two lists from the user. Create a dictionary from these two lists by taking the elements from the first list as keys, and take the elements in the second list as values.
- Write a “Python” script to read two tuples from the user. Create a dictionary from these two tuples by taking the elements from the first tuple as keys, and take the elements in the second tuple as values.
- Write a “Python” script to concatenate the two dictionaries in to one dictionary.
- Write a “Python” script to print the sum of all values in a dictionary.
- Write any “4” possible ways of creating a dictionary with ‘3’ key-value pairs.
- Write a “Python” script remove the key-value pair in a dictionary by taking input from the user.