python how to print a list code example
Example 1: python print list with newline
my_list = [1, 2, 3, 4]
print(*my_list, sep="\n")
Example 2: print string elements in list python
# list having all elements are strings
strings = ['string1', 'string2', 'string3', 'string4']
for string in strings:
print(string)
Example 3: how to print from a python list
list = ['a', 'b']
print(list[0])
#that will print 'a'
#print(list[1]) will print 'b'