0% found this document useful (0 votes)
56 views30 pages

Program Write in Practical File (2025-26)

The document outlines various Python programming tasks that involve user-defined functions for different operations such as displaying grades, counting words, reading and writing to binary and CSV files, and manipulating stacks. Each task includes specific requirements and expected outputs, focusing on data handling and processing. The tasks range from basic string manipulation to file operations and data filtering.

Uploaded by

rkdoxxxxx
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)
56 views30 pages

Program Write in Practical File (2025-26)

The document outlines various Python programming tasks that involve user-defined functions for different operations such as displaying grades, counting words, reading and writing to binary and CSV files, and manipulating stacks. Each task includes specific requirements and expected outputs, focusing on data handling and processing. The tasks range from basic string manipulation to file operations and data filtering.

Uploaded by

rkdoxxxxx
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/ 30

Write a python program by using a user defined function showGrades(s)

Write a python program by using a user defined function puzzle(W,N) that

OUTPUT
Write a program by using function countNow(PLACES) in Python, that takes the dictionary, PLACES as an
argument and displays the names (in uppercase)of the places whose names are longer than 5 characters. For
example, Consider the following dictionary PLACES={1:"Delhi",2:"London",3:"Paris",4:"New York",5:"Doha"}
The output should be: LONDON NEW YORK

output
Write a python program by using function, lenWords(STRING), that takes a string as an argument and returns a
tuple containing length of each word of a string. For example, if the string is "Come let us have some fun", the
tuple will have (4, 3, 2, 4, 4, 3)

output
Write a program in python by using a function to count number of time ‘the’ present in a text file
pic.txt.

output
Write a python program by using function FilterWords() in python which read lines from a text file NewsLetter.TXT, and
display those words, which are lesser than 4 characters.

output
Consider a text file story.txt . Write a program in python by using a function to count number of
lower case alphabet present in a that text file

output
Write a program to get student data(roll no , name , marks)from user and write onto a binary file stu.dat .

output
Write a program to open a binary file stu.dat and display those record from that file who has scored more than 81.

output
Consider a binary file stu.dat storing student details(Roll no,Name,Marks).Write a program to update the marks of
those student who have scored more than 81.

output
Consider a binary file,items.dat containing records stored in the given format:
{item_id:[item_name,amount]}
Write a program by using a user defined function copy_new() that copies all records whose amount is greater than
1000 from items.dat to new_items.dat.
A binary file emp.dat has the following structure:
[Emp_Id,Name,Salary]
where
Emp_Id:Employee id
Name:Employee Name
Salary:Employee Salary
Write a program by using a function disp_detail(),that would read the contents of the file emp.dat and display
the details of those employees whose salary is below 25000.

output
Write a program to create a CSV file emp.csv to store employee data (Id, Name, Salary).

output
Write a python program to create a csv file product.csv and store multiple record at a time in that file.

output
Write a python program which will ask students name and roll no. If both match the records in a CSV file , it displays the
student’s English , Math and Computer Science marks.
The marks data is stored in a file student_marks.csv whose first 3 rows are as shown below:
Name , Roll No ,Comments ,English , Maths ,Computer Science
Nagesh Rao,12342, ,85,92,96
Simran Shah,14324,Absent for English test,A,87,99
Ravi Gulati,43234, ,76,97,81

output
Sangeeta wants to write a program by using the following function
Write a python program by using a function push(stk,lst),where lst is a list of numbers. From this list push all the
numbers which are divisible by 5 into stack stk implemented by using list.Display the stack if it has at least one
element otherwise display appropriate error message.

output
Write a python program by using function push(d1),where d1 is a dictionary containing details of stationery
items { sname : price}.The function should push the name of those items in the stack which have price greater
than 75. Also display the count of element pushed into the stack.

output
Consider a dictionary containing names and marks as key : value pairs of 5 students . Write a program with separate
user defined functions to perform the following operations:
(i) push the keys(name of the student) of the dictionary into a stack where the corresponding value(marks) is
greater than 70
(ii) Pop and display content of the stack

output
MYSQL Consider the following table product and write the output of the following query.
Consider the following table product and write the output of the following query.

Output :

Output :

You might also like