I have a project where i take user inputs and create a dance competition. In the second round, two couples are eliminated, but i cannot create a variable as its assigned to a number. I need it to be assigned to the couple name
A =final_score_A
C =final_score_C
D =final_score_D
F =final_score_F
elimination =[ A, C, D, F]#list created with new variables
elimination_lowest = min(elimination) #eliminate lowest value
elimination.remove(elimination_lowest) #removes lowest value from list
elimination_final = [elimination[0], elimination[1], elimination[2]] #create new list without other couple (only 3 left)
elimination_final_lowest = min(elimination_final)
elimination_final.remove(elimination_final_lowest)
value_1 = elimination_final[0]
value_2 = elimination_final[1]
print("------------------")
print("The couples that go through to the final are: ")
if final_score_A == value_1:
global final_A
final_A = value_1
print ("Couple A")
elif final_score_A == value_2:
global final_A
final_A = value_2
print ("Couple A")
if final_score_C == value_1:
global final_C
final_C = value_1
print ("Couple C")
elif final_score_C == value_2:
global final_C
final_C = value_2
print ("Couple C")
if final_score_D == value_1:
global final_D
final_D = value_1
print ("Couple D")
elif final_score_D == value_2:
global final_D
final_D = value_2
print ("Couple D")
if final_score_F == value_1:
global final_F
final_F = value_1
print ("Couple F")
elif final_score_F == value_2:
global final_F
final_F = value_2
print ("Couple F")
print("------------------")
print("Final round: ")
`I want the output to be, couple A/C/D/F are through to the next round. But rather than getting the couple name, i get their scores
Comments
Post a Comment