I just started python and tried to create a simple linear search program
list1=[4,2,7,5,12,54,21,64,12,32]
x=int(input("Please enter a number to search for : "))
for i in list1:
if x==i:
print("We have found",x,"and it is located at index number",list1.index(i))
My problem is if I change the list to [4,2,7,5,12,54,21,64,12,2,32] it doesn't output both locations of the 2 value.
Any help is much appreciated.