0
Hello. Pls tell me how to find second 'f' in the string like "oooofooof? I know only find and rfind operators((
6 Answers
+ 3
String = "oooofooof"
Count=0
for char in String:
Count += 1
if char == "f":
print(Count)
>5
>9
+ 1
You can loop trough the string letter by letter and compare if the current letter is 'f'
0
Thanks guys!!!
0
strong.index[f]
I think this works too, I'm new but trying
0
string not strong, sorry auto correct on my phone
0
Found an easy answer, if you need to find second substring)
Print(string.find('f', string.find('f') + 1))