As mentioned by others, print() does not return anything. Hence, None is printed. If you are wondering why the elements are properly printed, and then followed by 4 None
's, its because of how functions work.
A function is called and once every statement inside has been executed, a value is returned, but only if the function returns something.
In your case, print(i + ...)
called the print function on i, print was executed, meaning that it printed i to the console, and then its value was returned, which is None, since print() does n't return anything.
Coming to the solution, you could use the .join() method or the replace() method:
a = ts_file[7:].upper().replace("_", " ")
print(a)
or
a = (' ').join(ts_file[7:].upper().split("_"))
print(a)
The output:
04 RED ZONE CONVERSION
You could also do another thing, if you did n't care about what was stored in ts_title:
As soon as you assign ts_title with your list comprehension:
ts_title = [print(i + ' ', end="") for i in ts_file[7:].upper().split("_")]
if you run your script, you will get the expected output on the screen, just as I had explained at the start of the answer.