Python Assignment 9
Python Assignment 9
2. Write a program to accept n integers from the user, store them in a tuple and find
the second maximum and second minimum element. Note: read values into a list
and convert it into tuple.
3. Write a program to create two sets from a list of items and find out the identical
items.
Note: Read n values from user and add them to a list. Split the list into two sets
of size n/2 or n/2 and n/2+1.
4. Write a program using sets to solve the following problem. Assume there are two
subjects with m & n number of registered students respectively. Write a program
to read the names of those students and find the following
a. find the list of students who registered for only one subject
b. find the list of students who registered for both the subjects
c. find the list of students only registered for first subject
d. find the list of students only registered for second subject
5. Write a program to read two strings and print a new string which contains all
uncommon characters from both the strings.
Ex: String 1: HellO
String 2: Hihello
Output: Oiho
6. Write a program to find difference of the elements in two matrices of size MxN.
7. Write a program to find the given matrix of size NxN is symmetric or not.
8. Write a program to sort the elements in all columns of a given MxN matrix.
9. Given a text, write a program to find the number of occurrences of a given word
in the text.
Ex: Text: Hello, welcome to python programming lab! Happy Programming :)
Word: Programming
Output: Programming occurred 2 times.
10. Write a program to check whether a given string is pangram or not. Note: A string
is a pangram if it contains all 26 English alphabets(case insensitive).