0
Q:

print list in lines python

my_list = [1, 2, 3, 4]
print(*my_list, sep="\n")
0
# Python program to print list 
# without using loop 
  
a = [1, 2, 3, 4, 5] 
  
# printing the list using * operator separated  
# by space  
print(*a) 
  
# printing the list using * and sep operator 
print("printing lists separated by commas") 
  
print(*a, sep = ", ")  
  
# print in new line 
print("printing lists in new line") 
  
print(*a, sep = "\n") 
0
# using for loop
scores = [11, 12, 13, 14, 15, 16]
for score in scores:
    print(score)
0

New to Communities?

Join the community