LIST OF SAMPLE PROGRAMS:
1. a) Write a python script to perform different Arithmetic
Operations on numeric data types in Python (CO1).
b)Develop a program to replace a specific word or phrase in a text file
with another word or phrase. CO2
2. a) Write a program to display Pascal’s triangle.
b)Create a program to encrypt and decrypt a text file using a simple
substitution cipher technique. CO2
3. a )Write a python program that uses a while loop to add up all the
even numbers between 100 and 200.
b )Create a program to extract all words containing a specific
substring from a text document. CO2
4. a )Write a python Program to Demonstrate a Function with and
without Arguments (CO1)
b )Write a Python program that utilizes regular expressions to
extract all email addresses from a given text document. CO2
5. a )Demonstrate how functions return multiple values with an example.
b )Implement a program to extract all phone numbers (including
various formats) from a string using regular expressions. CO2
6. a )Implement a program to count the occurrences of each
character in the given string.CO1.
b) Create a class called library with data attributes like
acc_number, publisher, title and author. The methods of the class
should include
a. read() – acc_number, title, author.
b. compute() - to accept the number of days late,
calculate and display the fine
charged at the rate of $1.50 per day.
c. display the data. CO2
7. a ) Develop a program to check if a given string, is a palindrome.CO1
b )Define a Car class with attributes such as make, model, and color,
along with methods for displaying information and changing
attributes. CO3
8. a )Write a program to search for a substring within a given string and print
its index. CO1
b )Create a Vehicle base class with common attributes and methods,
and then derive Car and Motorcycle classes inheriting from it. CO3
9. a )Implement a program to find all occurrences of a specific pattern within a
string. CO1
b )Write a program to add two polynomials using classes CO3
10. a )Write a python program to create, append, and remove
elements in lists in Python. (CO1)
b )Implement a Shape base class with common attributes and
methods, and then create subclasses like Rectangle, Circle, and
Triangle. CO3
11. a )Write a program that creates a list of numbers 1–100 that are
either divisible by 5 or 6 (CO1)
b )Define a class called student. Display the marks details of
top five students using inheritance. CO3
12. a )Write a python program to demonstrate working with dictionaries in
Python. (CO1)
b )Utilize polymorphism to create a function that takes objects of
different subclasses and calls their common methods. CO3
13. a )Write a program that has the dictionary of your friends’ names
as keys and phone numbers as its values. Print the dictionary in a
sorted order. Prompt the user to enter the name and check if it is
present in the dictionary. If the name is not present, then enter the
details in the dictionary(CO1)
b)Write a python program to calculate the sum of every column in a NumPy
array (CO4)
14. a )Write a python program to demonstrate working with Sets in Python.
(CO1)
b )Explain NumPy integer indexing, array indexing, Boolean array
indexing and slicing with examples. (CO4)
15. a)Write a python program to demonstrate working with Tuples in Python.
(CO1)
b)Write a Pandas program to join the two given data frames
along row and assign all data. (CO4).
16. a )Write a program that takes a range and creates a list of tuples
within that range with the first element as the number and the second
element as the square of the number. (CO1)
b )Write a Pandas program to append rows to an existing Data
Frame and display the combined data. (CO4)
17. a )Write a program to read a text file and count the occurrences of a specific
word. CO2
b )Write a Pandas program to count the number of missing values
in each column of a given Data Frame (CO4)
18. a )Implement a program to extract specific lines containing a keyword
from a text file and write them to another file. CO2
b )Write Python program to add, subtract, multiply and divide two Pandas
Series. (CO4)