A CSV file "P_record.csv" contains the records of patients in a hospital. Each record of the file contains the following data:
- Name of a patient
- Disease
- Number of days patient is admitted
- Amount
For example, a sample record of the file may be:
["Gunjan", "Jaundice", 4, 15000]
Write the following Python functions to perform the specified operations on this file:
(i) Write a function read_data() which reads all the data from the file and displays the details of all the 'Cancer' patients.
(ii) Write a function count_rec() which counts and returns the number of records in the file.
Comments