You could read the csv using pandas and then find the age of bob:
import pandas as pd
df = pd.read_csv("<file_path>")
bobs_age = df[df['name'] == 'bob']['age']
print(bobs_age)
Another way is to read the csv line by line:
import csv
with open("<file_path>", newline='') as csvfile:
csv_reader = csv.reader(csvfile, delimiter=',', quotechar='|')
for row in csv_reader:
name, gender, age = row
if name == 'bob':
bobs_age = age
print(bobs_age)
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…