To resolve this issue you will need to implement a repeat loop and scroll through such list with the help of enumerate function().
Following this logic we can implement the following code:
l = [1, 6, 6, 2, 3, 6]
l2 = list()
for indice, item in enumerate(l):
if item == 6:
l2.append(indice)
print(l2)
Note that when we execute this code the loop for will go through the entire list l and with the help of the enumerate verify the indexes of their elements. And, if the said element has value 6, its index will be added to the list L2. And then the list L2 will be shown.
The exit will be:
[1, 2, 5]
Another interesting way to resolve this issue is to use List Comprehensio. In this case the code could be left with only 1 code line. The code would be:
print([indice for indice, item in enumerate([1, 6, 6, 2, 3, 6]) if item == 6])