Vivek Python Assign
Vivek Python Assign
BILASPUR (C.G.)
Session 2024-25
Answer :-
Output :-
2. Write a program in python using user defined function to
find.
• Sum of n natural numbers
• Sum of digits
Answer :-
Output :-
3. Write a menu driven program in Python using user
defined function to
• Display factorial of a number
• Display n terms of Fibonacci series
Answer :-
Output :-
4. Write a menu driven program in Python using user
defined function to
• Check if a string is a palindrome
• Find length of a string
• Reverse a string
Answer :-
Output :-
5. Write a menu driven program in Python using user
defined function to
• Selection sort
• Bubble sort
Answer :-
Output :-
6. Write a menu driven program in Python using function to
read a text file and
• Count number of characters
• Count number of words
Answer :-
Output :-
7. Write a menu driven program in Python using function to
• Read a text file line by line and display each word
separated by a #.
• Read a text file and remove all the lines that contain the
character `a9 in a file and write it to another file.
Answer :-
Output :-
8. Write a program in Python using function to read a text
file and display the number of vowels/ consonants/
uppercase/ lowercase characters/special characters in the
file.
Answer :-
Output :-
Answer :-
Output :-
10. Write a menu driven program in Python to perform
linear and binary search on a set of numbers.
Answer :-
Output :-
11. Write a menu driven program in Python using Pickle
library and ,
• Create a binary file with following structure
• Admission number • Student name • Age
• Display the contents of the binary file
• Display the student whose age is above user given value
• Search a student by admission number given by user
Answer :-
Output :-