+ 3
Izzy the iguana
My code fails at the case 4 and 5... I need help ✋🏻 https://sololearn.com/compiler-playground/c3Kavs5Nl45o/?ref=app
7 Antworten
+ 6
Solo Soul ,
just a hint about the code line:
str=input()
the variable name `str`, that is used to store the input text from the user, is also a builtin class in python, that will be redefined / reassigned by the code . in the current case it does not matter.
but if string methods would be used in the code, we can get an unexpected behavior and the program will crash.
so take care about the variable names that are used.
+ 1
Bro it still fails the same test cases 4,5 😕
+ 1
Solo Soul ,
I was going to help, but those 1-space indentations are too hard on the eyes.
Be kind to your readers and use four spaces.
+ 1
It works with this code
0
It comes from the loop it's on each character of the string 'str' instead of the separate words.
you need to replace str with word
0
you only need to replace the str loop with world
and the other str linked to a condition must be replaced by the loop variable
you must not use in 'in' the condition
it has to be like this ‘ if “Mango” == i : ’ for example