+ 2
Why output is always Not found?
I made this code about country flags. For example, if our input is Germany then output will be 🇩🇪, and so on. And if input is not in the data then, Not found. But I don't know why it is not working? https://code.sololearn.com/cuaMEeXDWg0Q/?ref=app
9 Respuestas
+ 6
I got it.
I used keyboard auto fill option. I missed to consider the space at the end.
Thank you guys 😊
+ 5
I typed "Russia" and it works just fine. What input are you giving?
+ 5
JUMP_LINK__&&__Python__&&__JUMP_LINK Learner When i type the country name fully, its give me correct output (flag), when i try to fill by auto fill option by keyboard suggestion option. It's output(Not found). That's the matter here.
But i like your code. Happy learning 💐
+ 2
JUMP_LINK__&&__Python__&&__JUMP_LINK Learner you must type the uppercase and lowercase letters exactly. It will fail to find "Armenia" if you enter "armenia".
+ 1
Works fine for me
+ 1
I'd suggest adding ".capitalize()" to the input function so that you dont have to make everything start with a capital letter manually
+ 1
U forgot to uppercase the furst letter. I wrote all and its works:)
+ 1
JUMP_LINK__&&__Python__&&__JUMP_LINK Learner You may find the strip() method useful in this case. It returns a new string with the spaces trimmed from either side (if any). Here's how you do it:
input().strip()
# Hope this helps
0
It's so easy