I want to use the For Loop and print a row one by one whatever i required. here is my code:
import csv
with open("details.csv") as csvFile:
reader = csv.DictReader(csvFile)
for row in reader:
if['age'] == '21':
print(row['Name'], row['age'], row['DOB'])
else:
continue
Here i want run the for loop until 6 times and also i want specific data of who ever age is '21', that person details only i want print, if it is other than '21' then skip the row. but my code is doesn't perform exactly like i want. can anyone help me..? Thank you :)
my csv is:
Name age dob
Arun 21 01/08/93
Banni 20 05/11/94
charan 23 23/03/92
nani 21 04/05/93