Professional Documents
Culture Documents
Q1. Write a program that has a dictionary of states and their codes. Add another state in the
pre-defined dictionary, print all the items in the dictionary, and try to print code for a state that
does not exist. Set a default value before printing.
Q3. Write a program that prints a histogram of characters' frequencies occurring in a message.
Q4. Write a program that generates a set of prime numbers and another set of odd numbers.
Demonstrate the result of union, intersection, difference, and symmetric difference operations
on these sets.
Q5. Write a program that creates two sets-square and cubes in the range 1-10. Demonstrate the
use of update (), pop (), remove (), add (), and clear () functions.
Q6. Write a program that accepts the different number of arguments and returns the sum of
only the positive value passed to it.
Q8. Write a program that accepts a matrix and prints the transpose of that matrix.
Q10. What is the use of the lambda function? Write a program to find the smaller of two
numbers using the lambda function.