You are on page 1of 2

Dictionaries and Sorting Question Paper

Short Ansers 2 marks each

1. How are dictionaries different from lists ?

2. When are dictionaries more useful than lists ?

3. Write a program to print the worker’s informations (Name age, salary) in records format.

4. What is a key-value pair with reference to Python dictionary ?

5. What are the characteristics of Python Dictionaries ?

6. What is sorting? Name some sorting Techniques.

7. What is the basic principal of sorting in bubble sort?

8. On which basis can you determine if an algorithm is efficient or not?

9. What is the basic principal of sorting in Insertion sort?

10. Why insertion sort is considered a better algorithm than bubble sort?

Long Ansers 4 marks each

11. Explain cmp(dict1, dict2) with example.

12. Explain str(dict) with example.

13. Describe dict.fromkeys( ) with example.

14. Write a Python program to input ‘n’ names and phone numbers to store it in a dictionary
and to input any name and to print the phone number of the particular name.

15. Write a Python program to input ‘n’names and phone numbers to store it in a dictionary
and to search and print the phone number of that particular name.

16. Write a code to create customer’s list with their number & name and delete any
particular customer using his /her number.

17. What is the main difference between insertion sort and bubble sort techniques?

18. Write a program to perform insertion sort in the list?


19. Write a program to perform bubble sort in the list?

You might also like