Why output is always Not found? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 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

30th Jul 2021, 3:40 PM
Python Learner
Python Learner - avatar
9 Answers
+ 6
I got it. I used keyboard auto fill option. I missed to consider the space at the end. Thank you guys 😊
30th Jul 2021, 4:12 PM
Python Learner
Python Learner - avatar
+ 5
I typed "Russia" and it works just fine. What input are you giving?
30th Jul 2021, 3:43 PM
Slick
Slick - avatar
+ 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 💐
1st Aug 2021, 6:01 AM
Sowmiyashree S
Sowmiyashree S - avatar
+ 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".
30th Jul 2021, 3:54 PM
Brian
Brian - avatar
+ 1
Works fine for me
30th Jul 2021, 3:44 PM
Abhay
Abhay - avatar
+ 1
I'd suggest adding ".capitalize()" to the input function so that you dont have to make everything start with a capital letter manually
1st Aug 2021, 1:18 AM
PresidentOfYes12
PresidentOfYes12 - avatar
+ 1
U forgot to uppercase the furst letter. I wrote all and its works:)
1st Aug 2021, 12:53 PM
Nố Nồ Nô Ôk
+ 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
1st Aug 2021, 5:50 PM
Calvin Thomas
Calvin Thomas - avatar
0
It's so easy
31st Jul 2021, 11:55 AM
🤑_Eyo_🤑
🤑_Eyo_🤑 - avatar