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

Test CSV File

The document outlines tasks related to CSV file handling, including advantages of CSV files, comparisons between CSV and text files, and file modes. It specifies programming functions for managing candidate records in a CSV file, reading employee records to find maximum salary, and processing survey data from a happiness CSV file. Additionally, it includes requirements for data input, output, and record management in Python.

Uploaded by

bludoggo2008
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)
101 views1 page

Test CSV File

The document outlines tasks related to CSV file handling, including advantages of CSV files, comparisons between CSV and text files, and file modes. It specifies programming functions for managing candidate records in a CSV file, reading employee records to find maximum salary, and processing survey data from a happiness CSV file. Additionally, it includes requirements for data input, output, and record management in Python.

Uploaded by

bludoggo2008
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

TEST : CSV FILE

1. Write the advantages of CSV file?


2. How the following are different?
a. CSV file and Text File
b. "a" and "w" file modes
c. writer( ) and reader( ) functions
3. Surya is a manager working in a recruitment agency. He needs to manage the records
of various candidates. For this, he wants the following information of each candidate
to be stored in csv file "Candidate.csv": -
Candidate_ID – integer
Candidate_Name – string
Designation – string
Experience – float

You, as a programmer of the company, have been assigned to do this job for Surya.

a. Write a function to input the data of a candidate and append it in a CSV file.
b. Write a function to read the data from the CSV file and display the data of all
those candidates whose Experience is more than 10 years and Designation is
"Clerk"
c. Write a function to remove the detail of the candidate whose Candidate ID is
passed as parameter

4. Create a function MAXSALARY( ) in Python to read all the records from an already
existing file record.csv which stores the records of various employees working in a
department. Data is stored under various fields as shown below:
E_code E_name Scale Salary
A01 Bijesh Mehra S4 65400
B02 Vikram Goel S3 60000
C09 Suraj Mehta S2 45300
…… …… …… ……
Function should display the row where the salary is maximum.
Note: Assume that all employees have distinct salary.

5. A csv file "Happiness.csv" contains the data of a survey. Each record of the file
contains the following data:
● Name of a country
● Population of the country
● Sample Size (Number of persons who participated in the survey in that country)
● Happy (Number of persons who accepted that they were Happy)
For example, a sample record of the file may be: [‘Signiland’, 5673000, 5000, 3426]
Write the following Python functions to perform the specified operations on this file: .
a) Read all the data from the file in the form of a list and display all those records for
which the population is more than 5000000.
b) Count the number of records in the file.

You might also like