I want to count email accounts of male and female separately the code I wrote is not working properly so can anyone help me with this, please here is my code thank you in advance
import csv
mailAcc = {}
femailAcc = {}
with open('1000 Records.csv', 'r') as csv_file:
csv_reader = csv.reader(csv_file)
for i in csv_reader:
email = i[6]
gender = i[5]
doman = email.split('@')[-1]
if doman in mailAcc:
if gender == 'm':
mailAcc[doman] = mailAcc[doman] + 1
else:
mailAcc[doman] = 1
if doman in femailAcc:
if gender == 'F':
femailAcc[doman] = femailAcc[doman] + 1
else:
femailAcc[doman] = 1
print('Mail Email accounts: ', mailAcc)
print('Femail Email Accounts: ', femailAcc)

CSVfile as pure text.