0% found this document useful (0 votes)
2 views23 pages

Vivek Python Assign

This document is an assignment for the B.Sc Hons Mathematics 3rd Semester course at Guru Ghasidas Vishwavidyalaya, focusing on Python programming. It includes a series of programming tasks that require the use of user-defined functions to perform various operations such as calculating perimeters, sorting, and file handling. Each task is designed to enhance the understanding of Python through practical applications.

Uploaded by

VIVEK KAUSHIK
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views23 pages

Vivek Python Assign

This document is an assignment for the B.Sc Hons Mathematics 3rd Semester course at Guru Ghasidas Vishwavidyalaya, focusing on Python programming. It includes a series of programming tasks that require the use of user-defined functions to perform various operations such as calculating perimeters, sorting, and file handling. Each task is designed to enhance the understanding of Python through practical applications.

Uploaded by

VIVEK KAUSHIK
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 23

GURU GHASIDAS VISHWAVIDYALAYA

BILASPUR (C.G.)
Session 2024-25

B.Sc Hons Mathmatics , 3rd Semester


SUBJECT : Python Programming (MINOR)
ASSINGMENT ON “Python Queries”
Department : CSIT
ROLL NO : 2307175
Enrollment Number : GGV/23/05575

SUBMITTED TO: - SUBMITTED BY: -


Mr. Omprakash Sir Vivek Kaushik
Assignment Questions
1. Write a program in python using user defined function to
find.
• Perimeter of a rectangle(2*length*breadth)
• Circumference of a circle(2*3.14*r)

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 :-

9. Write a menu driven program in Python using function to


read a text file and
• Append the words starting with letter 8T9 or 8t9 in a given
file in python.
• count the particular word occurrences in given string,
number of times in python.

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 :-

You might also like