0% found this document useful (0 votes)
3 views1 page

Python Assignment 9

The document outlines a Python lab assignment consisting of ten programming tasks. These tasks involve using tuples, sets, and matrices to perform various operations such as counting occurrences, finding maximum and minimum values, identifying identical items, and checking for pangrams. Each task includes specific requirements and examples to guide the implementation.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views1 page

Python Assignment 9

The document outlines a Python lab assignment consisting of ten programming tasks. These tasks involve using tuples, sets, and matrices to perform various operations such as counting occurrences, finding maximum and minimum values, identifying identical items, and checking for pangrams. Each task includes specific requirements and examples to guide the implementation.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

Python Lab Assignment-9

1. Write a program using tuples to count the number of occurrences of days in a


week from a given string.
Note: Read the input as single line(string) without any separators and parse it.
Ex: input = MonTueTueWedThuFriFriSatMonFriWed
Output: Mon – 2 , Tue – 2 , Wed – 2 ,Thu – 1, Fri – 3, Sat – 1, Sun – 0

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).

You might also like