The code below is two list that have been sorted from highest to lowest, with numerical values being read from a text file. I am trying to use these variables to write a league table, with the points (premier_league) being the primary variable, and the goal difference (goal_difference) being the secondary variable. If two of the variables in the premier_league list are equal, then the goal difference should be taken into account as to where they should be in the table.
premier_league = sorted([ARS_P,BOU_P,BRI_P,BUR_P,CAR_P,CHE_P,CRY_P,EVE_P,FUL_P,HUD_P,LEI_P,LIV_P,MANC_P,MANU_P,NEW_P,SOU_P,TOT_P,WAT_P,WHU_P,WOL_P,], reverse=True)
goal_difference = sorted([ARS_D,BOU_D,BRI_D,BUR_D,CAR_D,CHE_D,CRY_D,EVE_D,FUL_D,HUD_D,LEI_D,LIV_D,MANC_D,MANU_D,NEW_D,SOU_D,TOT_D,WAT_D,WHU_D,WOL_D,], reverse=True)
This isn't necessary but if there was a way to make is so that when the order of the table has been determined, the corresponding team to each variable is written into the text file in that order as well. Thanks.