I have to write a program which processes a csv file with all the names given in France since the 19th century. I want to separate the list in two. In the first, I want to put the boy’s name and in the second, I want to put the girl’s name. I tried many things but they have not worked. Could someone help me to find a solution please ?
Thanks in advance
import csv # création de listes vides pour les données liste =  masculin =  feminin =  # Ouverture du fichier with open("nat2018-groupe-NSI.csv", 'r', encoding ='UTF-8', newline = '') as f: liste_dicos = csv.reader(f) for prenom in liste_dicos : if ['sexe'] == '1' : masculin.append(prenom) else : feminin.append(prenom)