CSC_Term1_21.07.21_csv3.pptx ppt for compter science
VinoddV9e
7 views
7 slides
Sep 23, 2024
Slide 1 of 7
1
2
3
4
5
6
7
About This Presentation
Csc
Size: 417.29 KB
Language: en
Added: Sep 23, 2024
Slides: 7 pages
Slide Content
FILE HANDLING Class 12_CSc How to iterate through a CSV file in Python? csvreader is an iterable object. Hence, .next () method returns the current row and advances the iterator to the next row. Since the first row of our csv file contains the headers (or field names), we save them in a list called fields. Now, we iterate through remaining rows using a for loop. Each row is appended to a list called rows.
FILE HANDLING Class 12_CSc 1.Store the Country name, gold, silver and bronze medals won by 5 different countries in Asianic Games using CSV file. Read the file and print the content in the alphabetical order of country names in a neat format
FILE HANDLING Class 12_CSc
FILE HANDLING Class 12_CSc Write a function Create_csv () to store the city_name and rainfall during a month of 5 cities in “rainfall.csv” and another function Max_rainfall () to read the file and print the name of the city that received the highest rainfall.
FILE HANDLING Class 12_CSc
FILE HANDLING Class 12_CSc
FILE HANDLING Class 12_CSc Q1.Write a python program to write the following into a csv file named employee.csv with comma as delimiter and read it as a list.Also find the total salary. Structure of the record is employeeno,name,mobileno,salary and commission Q2. Write a program to add/insert records in file “data.csv”. Structure of a record is roll number, name , class and marks. Find the minimum marks