Basic Programs-3
Problems on SETS AND DICTIONARY IN PYTHON
1. Write a python code for Create an empty set and assign it to a variable.
2. Write a python code for Add three items to your empty set
3. Write a python code for Create a second set which includes at least one common element with
the first set.
4. Write a python code for Find the union, difference, symmetric difference, and intersection of
the two sets. Print the results of each operation.
5. Write a python code for Delete the item from set1
6. Write a python code for Remove the second set
7. Write a python code for Read the number from user and check if the number is present in the
set or not
8. Write a python code for Create the following Dictionary { "a":"apple", "b" :"ball", "c":"cat",
"d":"doll" }
9. Write a python code for Create a Dictionary with duplicate Values
[Link] a python code for Delete all Keys and values for the dictionary { "a":"apple",
"b" :"ball", "c":"cat", "d":"doll" }
[Link] a python code for the value from a Python dictionary based on the key
programmingLangauges = {1:"Python",2:"C",3:"CPP",4:”PHP”}
[Link] a python code for the keys and values from a dictionary
[Link] a python code to get the values of dictionary
[Link] a python code to Popping out items from a Python dictionary using pop() method
[Link] a python code to Convert two lists to a dictionary in Python
[Link] a python code to Deleting elements from a dictionary
[Link] a python code to Sorting elements in a Python dictionary
[Link] the sum of all values in a Python dictionary for myDict =
{"n1":100,"n2":200,"n3":300}
[Link] the min and max of values in a Python dictionary for myDict =
{"n1":100,"n2":200,"n3":300}
[Link] a python Dictionary with 10 items where keys are numbers and values are its square
[Link] values in a dictionary using another dictionary.
[Link] a list of tuples containing key-value pairs from a dictionary.
23. Convert a list of tuples into a dictionary.