CBSE Class 12 Computer Science
Question 109 of 136
Data File Handling — Question 48
Back to all questionsLet the file "contacts.csv" include the following sample data:
Aniketh,9876546707
Sanjeeth,8976548689
Amrutha,6786778908
import csv
with open("con.csv", "r") as file:
csvreader = csv.reader(file)
for row in csvreader:
if row:
name = row[0]
phone = row[1]
print("Name:", name,"\t\t" "Phone:", phone)Name: Aniketh Phone: 7868478767
Name: Sanjeeth Phone: 6766474789
Name: Amrutha Phone: 8749374678