I am trying to remove all strings from a list of tuples
ListTuples = [(100, 'AAA'), (80, 'BBB'), (20, 'CCC'), (40, 'DDD'), (40, 'EEE')]
I have started to try and find a solution:
output = [i for i in ListTuples if i[0] == str]
print(output)
But I can't seem to get my head around how I would get an output like:
[(100), (80), (20), (40), (40)]
The format is always (int, str).
[(<int>, <str>), ...]?int,str) the following could be a simple solution:output = [(i[0],) for i in ListTuples]