newline in python print code example
Example 1: python print list with newline
my_list = [1, 2, 3, 4]
print(*my_list, sep="\n")
Example 2: how to show output in a different line in python
>>> print(f"Hello\nWorld!")
my_list = [1, 2, 3, 4]
print(*my_list, sep="\n")
>>> print(f"Hello\nWorld!")