Class - 12 CBSE Computer Science Important File Handling Questions 2025
Write a Python program to read a given CSV file having tab delimiter.
Python File Handling
4 Likes
Answer
Let "example.csv" file contain the following data:
Name Age Gender
Kavya 25 Female
Kunal 30 Male
Nisha 28 Female
import csv
with open("example.csv", 'r', newline='') as file:
reader = csv.reader(file, delimiter='\t')
for row in reader:
print(row)
Output
['Name Age Gender']
['Kavya 25 Female']
['Kunal 30 Male']
['Nisha 28 Female']
Answered By
1 Like