Yes I tried with str.find() and str.replace() but it's replacing all the occurrences. But, I want to replace only the second occurrence?
I am a newbie. So please help
– Asish SahaOct 30 '17 at 19:47
1
It's a pity that you didn't include your attempts in the question. Currently it looks like you just want someone to write the code for you which is why the question is being poorly received. Please see [How to ask](https://stackoverflow.com/help/how-to-ask) and be sure to include your attempts.
– roganjoshOct 30 '17 at 19:50
1 Answers1
0
Here's a hint,
I recommend declaring an counter and initializing it to 0. Then each time you find an 'a' in the string, you increment the counter.