You are on page 1of 1

JSS Mahavidyapeetha

JSS Academy of Technical Education, Noida


B.Tech., IIIrd Sem (ECE/ME/CE)
Python Programming (KNC -302)
Assignment 3- AY 2022-23

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.

Q2. Write a program to store a sparse matrix as a dictionary.

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.

Q7. Write a program to find the median of a list of numbers.

Q8. Write a program that accepts a matrix and prints the transpose of that matrix.

Q9. Write a python program to implement stack and queue.

Q10. What is the use of the lambda function? Write a program to find the smaller of two
numbers using the lambda function.

You might also like