+ 1

String functions

I have been trying to run this code for a while now but I am unable to and I can't also find the bug even though it keep saying that the bug in line 5. Please can anyone assist me here? https://sololearn.com/compiler-playground/cAyyIw3cw7KL/?ref=app

24th Jun 2025, 1:42 PM
Emman
Emman - avatar
3 Respostas
+ 6
Try the last line like this: print(Animal.find("e")) Just as a note, you notice how the Capital A in Animal changes the colour of the text to blue, that's because the interpreter is thinking that your variable is actually something like a class or function. Better to do the variable with a lower case a, e.g. animal = "Bee" Hope it helps!
24th Jun 2025, 1:53 PM
Ausgrindtube
Ausgrindtube - avatar
+ 2
Correct Code :- #Declares a variable Animal = "Bee" #Displays the index of the first letter e print(Animal.find("e")) Your earlier code was finding e not "e" , it was treating e as variable not a character to find.
26th Jun 2025, 3:42 AM
Mayank Joshi
Mayank Joshi - avatar
+ 1
Thank you very much, it worked!
24th Jun 2025, 3:50 PM
Emman
Emman - avatar
OSZAR »