Ok, here I have another problem, I only need to find the position \n in my list.
list = ['abc', '\n', 'def', 'ghi', '\n', 'jkl']
So, I need to get the position of all the entries "\ n" from this list.
I used
a=list.index('\n')
but received only one value as '1'. How to get both positions?
eg. I will get a list with position '\ n'
position = ['1', '4']
'1' represents the first position of the list \ n in the list, and '4' represents the second in fourth place in the list.
source share