You are on page 1of 1

DICTIONARY ASSIGNMENT

1.Write a Python script to add a key to a dictionary.

2. Write a Python program to concatenate following dictionaries

to create a new one.

d1={1:100, 2:200}

d2={3:300, 4:400}

d3={5:500, 6:600}

3. Write a Python program to check if a given key already exists

in a dictionary.

4. Write a Python script to print a dictionary where the keys are

numbers between 1 and 15 (both included) and the values are


square of keys.

5. Write a Python program to sum all the items in a dictionary.

6. Write a Python program to remove a key from a dictionary.

D = {'a':1,'b':2,'c':3,'d':4}

7. Write a Python program to sort a dictionary by key.

8. Write a Python program to remove duplicates from Dictionary.

9.Write a program to determine frequency of number in a list of


numbers.

You might also like