You are on page 1of 2

PROGRAM-15

WAP to enter admission no. and search details student


in a CSV file“records.txt”containing list objects and
having structure as [name,rno,admno,class]
import csv
f=open("records.csv","r")
a=csv.reader(f)
x=input("enter admission no. of student")
for i in a:
if i[2]==x:
print("data found")
print("student name:",i[0])
print("student rno:",i[1])
print("student admno:",i[2])
print("student class:",i[3])
break
else:
print("no details found")
break
OUTPUT

You might also like