The problem is that you're trying to explain your code, and what your code is not doing/doing wrong.
What people need so they can help you, is for you to explain what problem you're trying to solve, and then share the code you've made as an attempt to solve such problem.
E.g. instead of asking
When I type '6' as an input value my code loops infinitely; how can I solve this?
you should probably ask*:
I'm making a program that receives input numbers from the user, and then it checks if the number already exists on a list; if it doesn't exist, it inserts it into an array, but if it exists, it prompts a message 'number already exists' and asks for another number. But when I enter 6 as an input value the program just loops infinitely.
*This is just a made-up example. In NO WAY am I saying this is exactly how you should phrase your specific question.
As a specific example of what's wrong with your question: reading your comments, it is inferred that you're making a sudoku game, and that what you're trying to accomplish is to allow the user to input a value as long as the value is not already on a specific area/zone of the puzzle. But there's NOTHING in your question that makes someone think you're trying to make a sudoku game, and that the problem you're trying to solve is to accept guesses from the user. If that's truly the case of your problem, both of those pieces of information are crucial for your question to be answerable.