0% found this document useful (0 votes)
3 views1 page

Assignment File

Uploaded by

anubhav03022009
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)
3 views1 page

Assignment File

Uploaded by

anubhav03022009
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

A.

Write a Python function that displays the number of times the word "Python"
appears in a text file named "[Link]".
B. Write and call a Python function to read lines from a text file [Link] and
display those lines which doesn’t start with a vowel (A, E, I, O, U) irrespective of their
case.
C. Raj is the manager of a medical store. To keep track of sales records, he has created
a CSV file named [Link], which stores the details of each sale. The columns of
the CSV file are: Product_ID, Product_Name, Quantity_Sold and Price_Per_Unit.
Help him to efficiently maintain the data by creating the following user-defined
functions: I. Accept() – to accept a sales record from the user and add it to the file
[Link]. II. CalculateTotalSales() – to calculate and return the total sales based
on the Quantity_Sold and Price_Per_Unit.
D. Mr. Ravi, a manager at a tech company, needs to maintain records of employees.
Each record should include: Employee_ID, Employee_Name, Department and
Salary. Write the Python functions to: I. Input employee data and append it to a
binary file. II. Update the salary of employees in the "IT" department to 200000.

You might also like