I have a list of string tuples (list[tuple[str, str]]) like this [('JimKing', 'TheKing'), ('GadgetKing', 'EnergyKing'), ('ThingKing', 'Energyking')]
and I would like to split and print the first string in the tuples eg list[0] = 'JimKing'
Thanks in advance
CodePudding user response:
There probably is a more pythonic way of doing this, but the following works:
for pair in my_list:
print(pair[0])