So I want to know the position of the number '1' in the arrays, My code detects the first '1' but it does not detect the one's after.
NumberOfPlayers=2
P1SCOREARRAY=[1,3,1,3,4,5,6]
P2SCOREARRAY=[1,6,1,3,4,1,6]
#Hole
HOLEINONE=1
if NumberOfPlayers==2:
index = P1SCOREARRAY.index(HOLEINONE)
if index==0:
index=0+1
print("scored a hole in one in round--> ",index,)
index = P2SCOREARRAY.index(HOLEINONE)
if index==0:
index=0+1
print("scored a hole in one in round--> ",index,)
The output I get -->
scored a hole in one in round--> 1
scored a hole in one in round--> 1
The output I want -->
scored a hole in one in round--> 1,3
scored a hole in one in round--> 1,3,6