I am new to the website so sorry if this question is not as it should be. In my code, I am given a file with names of people and their ages, I need to find the maximum/minimum ages and the name of the male/female who has them. My problem is with the minimum, the code just wont read the if (I have tried elif too). Here is the female part of the code:
if sex_pas == 'female':
if age_pas == '':
continue
else:
if float(age_pas) >= float(max_female_age):
max_female_age = age_pas
max_female_name = line_split[3]
if float(age_pas) <= float(mini_female_age):
mini_female_age = age_pas
mini_female_name = line_split[3]
Aucun commentaire:
Enregistrer un commentaire