I have a list of Tuples that I want to print in Jupyter Notebooks. My code prints them correctly but seems to be printing a strange line at the end '[None,None,None]', I can't figure out why.
If I swap the list comprehension code with a for loop to print the same thing I don't get the '[None,None,None]' line. But I'm trying to write more easy to read code and would prefer to keep the list comprehension approach, there is definitely something I can learn from this mistake.
Check error message and code in the attached image
a = [(1, 108460.7476635514), (2, 103072.89682539682), (3, 77251.9265944645)]
[print('Group=', x[0], '; Avg=', x[1]) for x in a]