TERM I
1. Write an user-defined function to display randomly chosen few letters of a word from list of
words stored in a list. Word and letters are chosen in random. Ask the user to guess the
word. Motivate with proper message and award points to the user and display the same.
Write a program to implement the above said.
2. Write an user-defined function to add 'ing' at the end of a given string (length should be at
least 3). If the given string already ends with 'ing' then add 'ly' instead. If the string length of
the given string is less than 3, leave it unchanged. Write set of statements to implement the
above said.
3. Write a function in Python to combine the contents of two equi-sized lists A and B into third
list by computing their corresponding elements with the formula 2*A[i]+3*B[i]; where value
i varies from 0 to N-1 and transfer the resultant content in the third same sized list. Lists A &
B passed as parameters along with their sizes and the function returns the resultant array to
the calling place for displaying.
4. Create a dictionary with the roll number, name & marks of n students in a class
and display the names of those students who have scored marks above 75. Define
an user-defined function that accepts this dictionary as parameter and returns roll
numbers of those students to be displayed.
5. Write an user-defined function that accepts a tuple of numbers as parameters
and returns the largest and smallest numbers for displaying.
6. Read a text file line by line and display each word separated by a #.
7. Read a text file and display the number of vowels/ consonants/
uppercase/ lowercase characters in the file.
8. Create a binary file with name and roll number. Search for a given roll
number and display the name, if not found display appropriate message.
9. Create a binary file with roll number, name and marks in 5 subjects.
Input a roll number and update the marks. Create another new file with
the sorted list based on total in descending order. Display the resultant
file.
10. Remove all the lines that starts with the character `a' in a file and write it
to another file. Display the contents of Original and copied file
11. Write a function that reads a text file “story.txt” and store alternate
words in another file after reversing the word. Display the content of
story.txt and the newly created file.
12. Write a program that takes a sample of ten phishing e-mails (or any
text file) and find most commonly occurring word(s)
13. Write a program that creates a csv file with details department id,
department name, manager id and branch_location. Read the
content of the file created and display department name and
manager-id of all departments stored in csv file.
14. Write a Python program to write a Python list of lists to a csv file.
After writing the CSV file read the CSV file and display the content.
List consists itemnumber, itemname, price, brand of all item available
in the shop.
15. Write a Python program to write a Python dictionary to a csv file.
After writing the CSV file read the CSV file and display the
content. Keys in dictionary are bookid, booktitle,author, price, and
published year.
TERM 2
4. Write a menu driven Python program to implement push, pop and display operations in a stack with books details using
a list data-structure.
5. Write a program to convert an arithmetic expression which is in infix notation into postfix notation using stack. Accept
the arithmetic expression as input and display the resultant expression in postfix notation
Integrate SQL with Python by importing the MySQL module for completing following
programs.
16. Write a Python program to create a table student (admission number, name, class, total
mark and gender) and insert some records in that table. Finally selects all rows from the table
and display the records. Table student must be stored in school database.
17. Write a Python program to update a specific column value of student table and select all
rows before and after updating the data.
18. Write a Python program to display data in ascending / descending order using order by
clause.
19. Write a Python program to display tuples from student table after deleting a record
accepting student’s admission number
20. Write a python program to display the high score among girls and among boys in class 12.
Source code Date, heading, program number
Sample Input output Aim
Algorithm