-2

How can I print:

['12', '567', '32']

like

12
567
32

I tried pd.DataFrame but it gives row numbers i dont want that

Mad Physicist
  • 107,652
  • 25
  • 181
  • 264
jetrldz
  • 35
  • 5
  • Index into the list. The simplest way, beginner-friendly: name_of_variable = ['12', '567', '32'] print(name_of_variable[0]) print(name_of_variable[1]) print(name_of_variable[2]) – Olney1 Sep 08 '22 at 20:28

1 Answers1

2

The newline character \n prints a new line:

l = [12, 567, 32]
print('\n'.join(str(x) for x in l))
Tom McLean
  • 5,583
  • 1
  • 11
  • 36