In this program, we will take a string as input and find the first repeated character in a string and its index.
Steps to solve the program
- Take a string as input.
- Use for loop with range() function to find the first repeated character.
- Find the index of that character using Index().
- After finding the first character break the loop.
- Print the output.
Output :