FILE HANDLING PROGRAMS
data.txt
1) Display contents of data.txt file
Ans:
fin=open("data.txt")
str = fin.readline()
while str:
print(str)
str=fin.readline()
fin.close()
Output is:
mumbai is capital of maharashtra
pink IS beautiful
i am in KOLKAta
delhi is capital of India
1234 456
2) Create data.txt file (one line) and then display contents of data.txt file using append
mode.
Ans:
fin=open("data.txt","a")
s=input('Enter contents in file:')
fin.write(s)
fin.write('\n')
fin.close()
print('now reading file:')
fin=open('data.txt')
print(fin.read())
fin.close()
Output is;
Enter contents in file:HELLO! HOW ARE YOU?
now reading file:
mumbai is capital of maharashtra
pink IS beautiful
i am in KOLKAta
delhi is capital of India
1234 456
HELLO! HOW ARE YOU?
3) Count the number of characters from a file. (Don’t count white spaces)
fin=open("data.txt")
str=fin.read()
L=str.split()
ch=0
for i in L:
ch=ch+len(i)
print('No. of characters are:',ch)
fin.close( )
Output is:
No. of characters are: 83
4) Count number of alphabets from data.txt
Ans:
fin=open("data.txt")
str=fin.read()
ch=0
for i in str:
if i.isalpha():
ch=ch+1
print('No. of alphabets are:',ch)
fin.close( )
Output is:
No. of alphabets are: 95
5) Count the number of words in a file.
fin=open("data.txt",'r')
str=fin.read()
L=str.split()
count_words=0
for i in L:
count_words=count_words+1
print(‘No. of words are:’,count_words)
fin.close( )
Output is:
No. of words= 19
6) Count number of lines in a text file.
fin=open("data.txt",'r')
str=fin.readlines()
count_line=0
for i in str:
count_line=count_line+1
print(‘No. of lines are:’,count_line)
fin.close( )
Output is:
No. of lines= 5
7) Count number of vowels from a text file.
fin=open("data.txt")
str=fin.read()
count=0
for i in str:
if ((i=='a' or i=='e' or i=='i' or i=='o' or i=='u') or (i=='A' or i=='E' or i=='I' or i=='O' or
i=='U')):
count=count+1
print('No. of vowels are:',count)
fin.close( )
Output is:
No. of vowels are: 35
8) Count number of vowels and consonants from data.txt file
Ans:
fin=open("data.txt")
str=fin.read()
vcount=0
ccount=0
for i in str:
if ((i=='a' or i=='e' or i=='i' or i=='o' or i=='u') or (i=='A' or i=='E' or i=='I' or i=='O' or
i=='U')):
vcount=vcount+1
elif i.isalpha():
ccount=ccount+1
print('No. of vowels are:',vcount)
print('No. of consonants are:',ccount)
fin.close( )
Output is:
No. of vowels are: 45
No. of consonants are: 51
9 ) Count the number of ‘is’ word in a text file.
fin=open("Book.txt",'r')
str=fin.read()
L=str.split()
count=0
for i in L:
if i=='is':
count=count+1
print('No. of is words :',count)
fin.close( )
Output is:
No. of is words : 2
10) Count the number of ‘is’ and ‘IS’ word in a text file.
Ans:
fin=open('data.txt')
c=0
c1=0
s=fin.read()
st=s.split()
print(st)
for i in st:
if i=='is':
c=c+1
if i=='IS':
c1=c1+1
print('count of word small is =',c)
print('count of capital IS =',c1)
fin.close()
Output is:
['mumbai', 'is', 'capital', 'of', 'maharashtra', 'pink', 'IS', 'beautiful', 'i', 'am', 'in', 'KOLKAta',
'delhi', 'is', 'capital', 'of', 'India', '1234', '456']
count of word small is = 2
count of capital IS = 1
11) Count the number of ‘is’ and ‘IS’ word in a text file.
Ans:
fin=open('data.txt')
c=0
c1=0
s=fin.read()
st=s.split()
print(st)
for i in st:
if i=='is' or i==’IS’:
c=c+1
print('count of word is/IS =',c)
fin.close()
Output is:
['mumbai', 'is', 'capital', 'of', 'maharashtra', 'pink', 'IS', 'beautiful', 'i', 'am', 'in', 'KOLKAta',
'delhi', 'is', 'capital', 'of', 'India', '1234', '456']
count of word small is = 3
12) Count number of digits in a text file.
Ans:
fin=open("data.txt")
str=fin.read()
ch=0
for i in str:
if i.isdigit():
ch=ch+1
print(i)
print('No. of digits are:',ch)
fin.close( )
Output is
1
2
3
4
4
5
6
No. of digits are: 7
13) Count number of lowercase alphabets from data.txt
Ans:
fin=open("data.txt")
str=fin.read()
ch=0
for i in str:
if i.islower():
ch=ch+1
print('No. of lowercase characters are:',ch)
fin.close( )
Output is:
No. of lowercase characters are: 68
14) Count number of spaces from data.txt
Ans:
fin=open("data.txt")
str=fin.read()
ch=-1
for i in str:
if i.isspace():
ch=ch+1
print('No. of spaces are:',ch)
fin.close( )
Output is:
No. of spaces are: 18
15) Count number of uppercase alphabets from data.txt
Ans:
fin=open("data.txt")
str=fin.read()
ch=0
for i in str:
if i.isupper():
ch=ch+1
print('No. of characters are:',ch)
fin.close( )
Output is:
No. of characters are: 8
16) Write python code to count number of words whose length is more than 5 from data.txt.
Ans:
fin=open("data.txt")
d=fin.read()
w=d.split()
c=0
for a in w:
if len(a)>5:
c=c+1
print(a)
print('No. of words having length more than 5 =',c)
fin.close()
Output is: mumbai
capital
maharashtra
beautiful
KOLKAta
capital
No. of words having length more than 5 = 6
17) Write a program to take the details of book from the user and write the record in
text file.
fout=open("Book.txt",'w')
n=int(input("How many records you want to write in a file ? :"))
for i in range(n):
print("Enter details of record :", i+1)
title=input("Enter the title of book : ")
price=float(input("Enter price of the book: "))
record=title+" , "+str(price)+'\n'
fout.write(record)
fout.close( )
Output is:
How many records you want to write in a file ? :2
Enter details of record : 1
Enter the title of book : swami
Enter price of the book: 450
Enter details of record : 2
Enter the title of book : c++
Enter price of the book: 350
18) Write multiple sentences in text file.
Ans:
fout=open("practice.txt","w")
while True:
n= input("Enter data to save in the text file: ")
fout.write(n)
fout.write('\n')
ans=input("Do you wish to enter more data?(y/n): ")
if ans=='n':
break
fout.close()
Output is:
19) Write contents in report.txt file and display all contents also
Ans:
fout=open('report.txt', 'a+')
print ('WRITING DATA IN THE FILE')
print()
while True:
line= input('Enter a sentence=')
fout.write(line)
fout.write('\n')
choice=input('Do you wish to enter more data? (y/n): ')
if choice in ('n','N'): break
print('The byte position of file object is ',fout.tell())
fout.seek(0) #places file object at beginning of file
print()
print("READING DATA FROM THE FILE=")
str=fout.read()
print(str)
Output is:
WRITING DATA IN THE FILE
Enter a sentence=HI! I am Good
Do you wish to enter more data? (y/n): n
The byte position of file object is 49
READING DATA FROM THE FILE=
i love india
hello how are you?
HI! I am Good
20) Write a python code that displays the number of lines starting with 'H' in the
file para.txt
Ans:
f = open ('para.txt' , 'r' )
lines =0
L=f.readlines ()
for i in L:
if i [0]== 'H':
lines +=1
print ('No. of lines are:', lines)
Output is:
No. of lines are: 2
21) Write a python code to read the text file "data.txt" and count the number of
times "my" occurs in the file.
For example if the file data.txt contains‐"This is my website.I have displayed my
preference in the CHOICE section ".‐ then display
output :"my occurs 2 times".
Ans:
fin=open('data.txt')
c=0
s=fin.read()
st=s.split()
for i in st:
if i=='my':
c=c+1
print('count of word small is =',c)
fin.close()
22) Write a code in python to read lines from a text file para.txt and display those
lines which start with the alphabets P.
Ans:
file=open('para.txt' , 'r')
line= file.readline()
while line:
if line[0]== 'p':
print(line)
line=file.readline ()
file.close()
output is:
parrot is green
23) Write a code in python to read lines from a text file MYNOTES.TXT and
display those lines which start with alphabets 'K'
Ans:
file=open(MYNOTES.TXT’ , ‘r’)
line=file.readline()
while line:
if line[0]==’K’ :
print(line)
line=file.readline()
file.close()
Output is:
KOLKATTA IS NICE CITY
24) write a program to display all the records in a file along with line/record number.
Ans:
f = open("data.txt",'r')
data = f.readlines()
for i in range (len(data)) :
line = data[ i ].split(",")
for j in range (len(line)):
print(i+1,line[j],end='')
f.close()
Output is:
1 mumbai is capital of maharashtra
2 pink IS beautiful
3 i am in KOLKAta
4 delhi is capital of India
5 1234 456a
6 HELLO! HOW ARE YOU?
7 HELLO
25) Write python code to count number of ‘he’ and ‘she’ separately from abc.txt file.
Ans:
f=open('abc.txt','r')
c=0
s=0
for line in f:
words = line.split()
for i in words:
if i=='He':
c=c+1
elif i=='She':
s=s+1
print("Occurrences of the word 'He' is :",c,' times')
print("Occurrences of the word 'She' is :",s,' times')
Output is:
Occurrences of the word 'He' is : 1 times
Occurrences of the word 'She' is : 0 times
24) Write python code to display line start with ‘g’ or ‘G’ also display line number.
Ans:
f=open ("abc.txt" ,"r")
count=0
lines= f.readlines()
for line in lines:
count+=1
if line[0] in ["g","G"] :
print(count,line)
f.close()
Output is:
8 Goa is beautiful city
25) Write python code to display size of abc.txt file
Ans:
f=open("data.txt","r")
str=" "
size=0
tsize=0
while str:
str=f.readline()
tsize=tsize+len(str)
size=size+len(str.strip())
print("Size of file after stripping extra characters",size)
print("Total size of file",tsize)
f.close()
Output is:
Size of file after stripping extra characters 154
Total size of file 162
26) Write python code to count number of lines ends with ‘a’
Ans:
count =0
f=open ("data.txt","r")
data=f.readlines() # data will be list of string
for line in data:
if line[-2] == 'a':
count=count+1
print("Number of lines having 'a' as last character is/are : " ,count)
f.close()
Output is:
Number of lines having 'a' as last character is/are : 4
27) Write python code to count number of words which contains 4 letters in word
from abc.txt
Ans:
f=open ("data.txt" ,"r")
count=0
x= f.read()
word =x.split ()
for i in word:
if (len(i) == 4):
count =count + 1
print ("No.of words having 4 characters is" ,count)
f.close()
Output is:
No.of words having 4 characters is 6
28) Consider a text file emp.txt containing details such as empno,ename,salary.
Write a python code to display details of those employees who are earning
between 20000 and 90000(both values inclusive)
Ans:
i=open( 'emp.txt' , 'rb+')
x=i.readline()
while(x):
I= x.split()
if ((float (I[2]) >=20000) and (float (I[2])<=90000)):
print(x)
x= i.readline()
Output is:
10 abc 60000
11 xyz 89000
29) Write a program that copies a text file "oldfile.txt" onto "newfile.txt" barring
the lines starting with @ sign.
Ans:
fin =open ('oldfile.txt','r')
fout= open ('newfile.txt', 'w')
text =fin.readlines()
for line in text:
if line[0]== '@':
fout.write(line)
fin.close()
fout.close()
Output is:
30) Write a python code that accepts a filename, and copies all lines that do not start with a
lowercase letter from the first file into the second.
Ans:
fin =open ('oldfile.txt','r')
fout= open ('newfile.txt', 'w')
text =fin.readlines()
for line in text:
if line[0].isalpha():
if not line[0] in 'abcdefghijklmnopqrstuvwxyz':
fout.write(line)
fin.close()
fout.close()
Output is:
31) Write a Python code to find the size of the file in bytes, number of lines and number of
words.
Ans.
f = open('data.txt', 'r')
str = f.read()
size = len(str)
print('size of file n bytes ', size)
f.seek(0)
L = f.readlines()
word = L.split()
print('Number of lines ', len(L))
print('Number of words ', len(word))
f.close()
Binary File Operations – USING pickle module
1) Write python code to create single record using lost for student (Rollno, Name,Gender,
Marks), store to binary file and also display it .
Ans:
import pickle
listvalues=[1,"Geetika",'F', 26]
fileobject=open("mybinary.dat", "wb")
pickle.dump(listvalues,fileobject)
fileobject = open('mybinary.dat','rb+')
print ('Details of Binary file: ')
while True:
try:
rec = pickle.load(fileobject)
print('Roll Num:',rec[0])
print('Name:',rec[1])
print('Gender:',rec[2])
print('Marks:',rec[3])
except EOFError:
break
fileobject.close()
Output is:
Details of Binary file:
Roll Num: 1
Name: Geetika
Gender: F
Marks: 26
2) Write python code to create single record using dictionary for student (rollno, name,
marks), store to binary file and also display it.
Ans:
import pickle
rollno = int(input('Enter roll number:'))
name = input('Enter Name:')
marks = int(input('Enter Marks:'))
#Creating the dictionary
rec = {'Rollno':rollno,'Name':name,'Marks':marks}
#Writing the Dictionary
f = open('student.dat','ab')
pickle.dump(rec,f)
f.close()
f = open('student.dat','rb')
while True:
try:
rec = pickle.load(f)
print('Roll Num:',rec['Rollno'])
print('Name:',rec['Name'])
print('Marks:',rec['Marks'])
except EOFError:
break
f.close()
Output is:
Enter roll number:3
Enter Name:ANJALI
Enter Marks:469
Roll Num: 3
Name: ANJALI
Marks: 469
3) Write python code to create multiple records for student (rollno, name, marks), store to
binary file and also display record.
Ans:
import pickle
while True:
rollno = int(input('Enter roll number:'))
name = input('Enter Name:')
marks = int(input('Enter Marks:'))
#Creating the dictionary
rec = {'Rollno':rollno,'Name':name,'Marks':marks}
#Writing the Dictionary
f = open('student.dat','ab')
pickle.dump(rec,f)
ch=input('Wish to enter more record (Y/N):')
if ch=='N' or ch=='n':
break
f.close()
f = open('student.dat','rb')
while True:
try:
rec = pickle.load(f)
print('Roll Num:',rec['Rollno'])
print('Name:',rec['Name'])
print('Marks:',rec['Marks'])
except EOFError:
break
f.close()
Output is:
Enter roll number:4
Enter Name:archana
Enter Marks:455
Wish to enter more record (Y/N):y
Enter roll number:5
Enter Name:aakash
Enter Marks:467
Wish to enter more record (Y/N):n
Roll Num: 4
Name: archana
Marks: 455
Roll Num: 5
Name: aakash
Marks: 467
4) Write python code to search roll number from student.dat and display it.
Ans:
import pickle
f = open('student.dat','rb')
flag = False
r=int(input('Enter rollno to be searched='))
while True:
try:
rec = pickle.load(f)
if rec['Rollno'] == r:
print('Roll Num:',rec['Rollno'])
print('Name:',rec['Name'])
print('Marks:',rec['Marks'])
flag = True
except EOFError:
break
if flag == False:
print('No Records found')
f.close()
Output is:
Enter rollno to be searched=1
Roll Num: 1
Name: APARNA
Marks: 450
5) Write python code to update details of student.dat by entering roll no.
Ans:
import pickle
f=open('student.dat','rb+')
found=0
r=int(input('Enter roll no to search :'))
while True:
rec=pickle.load(f)
if rec['Rollno']==r:
print('Current name is:',rec['Name'])
print('Current Marks are:',rec['Marks'])
rec['Name']=input('Enter new name:')
rec['Marks']=int(input('Enter new marks:'))
found=1
break
if found==1:
f.seek(0)
pickle.dump(rec,f)
print('Record updated')
f.close()
Output is:
Enter roll no to search :1
Current name is: APARNA
Current Marks are: 450
Enter new name:APARNA DHIRDE
Enter new marks:456
Record updated
6) Write python code to delete details of student.dat by entering roll no.
Ans:
import pickle
f = open('student.dat','rb')
reclst = []
r=int(input('Enter roll no to be deleted:'))
while True:
try:
rec = pickle.load(f)
reclst.append(rec)
except EOFError:
break
f.close()
f = open('student.dat','wb')
for x in reclst:
if x['Rollno']==r:
continue
pickle.dump(x,f)
print('Record Deleted')
f.close()
Output is:
Enter roll no to be deleted:1
Record Deleted
7) Write a menu driven code in python to insert, search, update display and delete record
from student.dat file
Ans:
import pickle
#Accepting data for Dictionary
def insertRec():
rollno = int(input('Enter roll number:'))
name = input('Enter Name:')
marks = int(input('Enter Marks'))
#Creating the dictionary
rec = {'Rollno':rollno,'Name':name,'Marks':marks}
#Writing the Dictionary
f = open('d:/student.dat','ab')
pickle.dump(rec,f)
f.close()
#Reading the records
def readRec():
f = open('d:/student.dat','rb')
while True:
try:
rec = pickle.load(f)
print('Roll Num:',rec['Rollno'])
print('Name:',rec['Name'])
print('Marks:',rec['Marks'])
except EOFError:
break
f.close()
#Searching a record based on Rollno
def searchRollNo(r):
f = open('d:/student.dat','rb')
flag = False
while True:
try:
rec = pickle.load(f)
if rec['Rollno'] == r:
print('Roll Num:',rec['Rollno'])
print('Name:',rec['Name'])
print('Marks:',rec['Marks'])
flag = True
except EOFError:
break
if flag == False:
print('No Records found')
f.close()
#Marks Modification for a RollNo
def updateMarks(r,m):
f = open('d:/student.dat','rb')
reclst = []
while True:
try:
rec = pickle.load(f)
reclst.append(rec)
except EOFError:
break
f.close()
for i in range (len(reclst)):
if reclst[i]['Rollno']==r:
reclst[i]['Marks'] = m
f = open('d:/student.dat','wb')
for x in reclst:
pickle.dump(x,f)
f.close()
#Deleting a record based on Rollno
def deleteRec(r):
f = open('d:/student.dat','rb')
reclst = []
while True:
try:
rec = pickle.load(f)
reclst.append(rec)
except EOFError:
break
f.close()
f = open('d:/student.dat','wb')
for x in reclst:
if x['Rollno']==r:
continue
pickle.dump(x,f)
f.close()
while 1==1:
print('Type 1 to insert rec.')
print('Type 2 to display rec.')
print('Type 3 to Search RollNo.')
print('Type 4 to update marks.')
print('Type 5 to delete a Record.')
print('Enter your choice 0 to exit')
choice = int(input('Enter you choice:'))
if choice==0:
break
if choice == 1:
insertRec()
if choice == 2:
readRec()
if choice == 3:
r = int(input('Enter a rollno to search:'))
searchRollNo(r)
if choice == 4:
r = int(input('Enter a rollno:'))
m = int(input('Enter new Marks:'))
updateMarks(r,m)
if choice == 5:
r = int(input('Enter a rollno:'))
deleteRec(r)
Output is:
Type 1 to insert rec.
Type 2 to display rec.
Type 3 to Search RollNo.
Type 4 to update marks.
Type 5 to delete a Record.
Enter your choice 0 to exit
Enter you choice:1
Enter roll number:1
Enter Name:AYUSH
Enter Marks:450
Type 1 to insert rec.
Type 2 to display rec.
Type 3 to Search RollNo.
Type 4 to update marks.
Type 5 to delete a Record.
Enter your choice 0 to exit
Enter you choice:2
Roll Num: 1
Name: AYUSH
Marks: 450
Type 1 to insert rec.
Type 2 to display rec.
Type 3 to Search RollNo.
Type 4 to update marks.
Type 5 to delete a Record.
Enter your choice 0 to exit
Enter you choice:3
Enter a rollno to search:1
Roll Num: 1
Name: AYUSH
Marks: 450
Type 1 to insert rec.
Type 2 to display rec.
Type 3 to Search RollNo.
Type 4 to update marks.
Type 5 to delete a Record.
Enter your choice 0 to exit
Enter you choice:4
Enter a rollno:1
Enter new nameAYUSH KUMAR
Enter new Marks:500
Type 1 to insert rec.
Type 2 to display rec.
Type 3 to Search RollNo.
Type 4 to update marks.
Type 5 to delete a Record.
Enter your choice 0 to exit
Enter you choice:2
Roll Num: 1
Name: AYUSH KUMAR
Marks: 500
Type 1 to insert rec.
Type 2 to display rec.
Type 3 to Search RollNo.
Type 4 to update marks.
Type 5 to delete a Record.
Enter your choice 0 to exit
Enter you choice:5
Enter a rollno:1
Record Deleted!!!
Type 1 to insert rec.
Type 2 to display rec.
Type 3 to Search RollNo.
Type 4 to update marks.
Type 5 to delete a Record.
Enter your choice 0 to exit
Enter you choice:0
CSV file operations
1) Write python code to read ‘dept.csv’ file containing columns as (d_id, d_name and city )
and display all records separated by comma
Ans:
import csv
print('Details of csv file:')
with open('dept.csv') as csvfile:
data = csv.reader(csvfile, delimiter=' ')
for row in data:
print(', '.join(row))
Output is:
Details of csv file:
10,sales,kolkatta
20,marketing,delhi
2) Write a program to read the contents of “dept.csv” file using with open()
Ans:
import csv
with open('dept.csv','r') as csv_file:
reader=csv.reader(csv_file)
rows=[ ]
for rec in reader:
rows.append(rec)
print(rows)
Output is:
[['d_id d_name city '], ['10 sales kolkatta'], ['11 marketing delhi']]
3) Write a program to count the number of records present in “dept.csv” file
Ans:
import csv
f=open('dept.csv','r')
csv_reader=csv.reader(f)
columns=next(csv_reader)
c=0
for row in csv_reader:
c=c+1
print('No.of records are:',c)
Output is
No.of records are: 2
Use of next() = The function next() is used to directly point to this list of fields to read the
next line in the CSV file. .next() method returns the current row and advances the iterator to
the next row.
4) Write a program to search the record of a particular student from CSV file on the basis of
inputted name.
Ans:
import csv
f=open('student.csv','r')
csv_reader=csv.reader(f)
name=input('Enter name to be searched:')
for row in csv_reader:
if (row[1]==name):
print(row)
Output is:
Enter name to be searched:APARNA
['1', 'APARNA', 'XII']
5) Write a program to add (append) Employee records onto a csv file.
Ans:
import csv
with open('student.csv',mode='a') as csvfile:
mywriter=csv.writer(csvfile,delimiter=',')
ans='y'
while ans.lower()=='y':
rno=int(input('Enter roll no:'))
name=input('Enter student name:')
clas=input('Enter class:')
mywriter.writerow([rno,name,clas])
print('## Data Saved ##')
ans=input('Add More?:')
Output is:
Enter roll no:4
Enter student name:MANGESH
Enter class:XI
## Data Saved ##
Add More?:y
Enter roll no:5
Enter student name:PRIYANKA
Enter class:XII
## Data Saved ##
Add More?:n
6) Write a menu-driven program implementing user-defined functions to perform different
functions on a csv file “student” such as:
(a) Write a single record to csv
(b) Write all the records in one single go onto the csv.
(c) Display the contents of the csv file
Ans:
import csv
def crcsv1():
with open('student.csv','a') as csvfile:
fobj=csv.writer(csvfile)
while True:
rno=int(input('Enter Roll no:'))
name=input('Name:')
marks = float(input("Marks:"))
Line=[rno,name,marks]
fobj.writerow(Line)
ch=input('More (Y/N):')
if ch=='N':
break
def crcsv2():
with open('student.csv','w') as csvfile:
fobj=csv.writer(csvfile)
Lines=[]
while True:
rno=int(input('Enter Roll no:'))
name=input('Name:')
marks = float(input("Marks:"))
Lines.append([rno,name,marks])
fobj.writerow(Lines)
ch=input('More (Y/N):')
if ch=='N':
break
fobj.writerows(Lines)
def showall():
with open('student.csv') as csvfile:
csvobj=csv.reader(csvfile)
for line in csvobj:
print(','.join(line))
print('csv file handling:')
while True:
opt=input('1: Create 2: CreateCSVAll 3:Show CSV 4.Quit\n')
if opt=='1':
crcsv1()
elif opt=='2':
crcsv2()
elif opt=='3':
showall()
else:
break
Output is:
csv file handling:
1: Create 2: CreateCSVAll 3:Show CSV 4.Quit
1
Enter Roll no:1
Name:ARCHANA SAKAT
Marks:453
More (Y/N):Y
Enter Roll no:2
Name:SUNIL
Marks:433
More (Y/N):N
1: Create 2: CreateCSVAll 3:Show CSV 4.Quit
3
1,ARCHANA SAKAT,453.0
2,SUNIL,433.0
1: Create 2: CreateCSVAll 3:Show CSV 4.Quit
2
Enter Roll no:3
Name:AAKASH
Marks:455
More (Y/N):N
1: Create 2: CreateCSVAll 3:Show CSV 4.Quit
3
[3, 'AAKASH', 455.0]
1: Create 2: CreateCSVAll 3:Show CSV 4.Quit
4
>>>