-3

I have a list like this

x = [['a','b','c','d']]

and I want to print all the elements in it like

a 
b
c
d
Mateen Ulhaq
  • 24,552
  • 19
  • 101
  • 135
  • Does this answer your question? [How can I print list index in one line and the list elements in the next line in Python?](https://stackoverflow.com/questions/64291066/how-can-i-print-list-index-in-one-line-and-the-list-elements-in-the-next-line-in) – Devang Sanghani Feb 22 '22 at 10:50
  • Does this answer your question? [Pythonic way to print list items](https://stackoverflow.com/questions/15769246/pythonic-way-to-print-list-items) – Michał Testka Feb 22 '22 at 10:50
  • `for item in x[0]: print(item)` – Mateen Ulhaq Feb 22 '22 at 10:51

1 Answers1

1
x = [['a','b','c','d']]
print('\n'.join(map(str, x[0])))

result will be

a
b
c
d