Stuck with code logic


I am trying to write a piece of code which takes an input from the user and searches it in the predefined array and returns a result.

If i put continue after else, the print statement does not get executed and if i remove the continue statement then the print statement is run for each item in the list.

what i want to do is that

  1. the user input is compared with each item in the list and if not available then print a single statement instead of printing a statement for each item in the list.

  2. if the same value is repeated at index position say x[2] and x[9], then print both the index position but in my code only the first index position is printed.

I am stuck with the logic to accomplish this.