Got this nested list
lst=[['','2018','2018','2015','2015','2012','2012','2009','2009','2006','2006','2003','2003'],
['','M','F','M','F','M','F','M','F','M','F','M','F'],
['Australia','494','488','497','491','510','498','519','509','527','513','527','522'],
['Austria','505','492','510','483','517','494','506','486','517','494','509','502'],
['Belgium','514','502','514','500','520','509','526','504','524','517','533','525'],
['Japan','532','522','539','525','545','527','534','524','533','513','539','530']]
Trying to find for each year if F > M, if so, print
Year Country Female Male
2018 Country 3 Score Score
2015 Country 1 ... ....
2013 Country 4 ... ....
2013 Country 5 ... ....
I’m thinking of looking at 2018 first, then 2015 and so on:
if lst[2][2]<lst[2][3]:
print('1')
Output from that is 1, so it seems to work.
for n in lst[2:]:
for element in n[1:]:
print(element)
Gives me a list of the scores.
But how do I put this together? "If F>M for 2018 print list, repeat on 2015"?
Source: Python Questions