+ 1
What happens when letters repeat in python list and then use index to find its occurrence??
I had a simple question that if I create a list as follows: letters=["s","d","h","g","h","k","j","h"] and then use index to count the occurrence of each letter. As you can see the letter 'h' has been repeated thrice. So in this case what would be the output??
1 Answer
+ 2
I tried out this program in python shell and the output showed that it counted the first occurrence of letter 'h'