replace
CardWithHighestValue= max(card_list,key=itemgetter(1)[0])
with
CardWithHighestValue= max(card_list,key=itemgetter(1))
Demo
from operator import itemgetter
card_list= [(2, (1, "S")), (0, (12, "H")), (1, (5, "C"))]
print max(card_list,key=itemgetter(1))
card_list= [(2, (1, "S")), (0, (4, "H")), (1, (5, "C"))]
print max(card_list,key=itemgetter(1))
Output:
(0, (12, 'H'))
(1, (5, 'C'))
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…