+ 2
Please guys help me with this... DICTIONARY FUNCTIONS, under PYTHON INTERMIDATE
data = { 'Singapore': 1, 'Ireland': 6, 'United Kingdom': 7, 'Germany': 27, 'Armenia': 34, 'United States': 17, 'Canada': 9, 'Italy': 74 } pick= input() print(data.get(pick, "Not Found")) #did "Not found" as well
8 Réponses
+ 3
CHRISTIAN ,
Notice Lothar used lowercase f in found.
What I usually do is copy the return strings from the description and paste them into my code. Rewriting them by hand only creates opportunity for error.
It's good practice for when a client gives you text they want you to use in the program you're writing for them. If you copy and paste, and the text is bad, your ass is covered, because you used what they gave you. Heh.
+ 5
CHRISTIAN ,
the text output (if key will not be found) should be "Not found"
^
+ 5
CHRISTIAN ,
just correct the output string as mentioned, then the code will pass all test cases.
+ 2
Thanks guys... Lothar u rock man!
+ 2
Sniper sight Rain...
+ 1
That's the point, Lothar... Bt somehow there seems to be something missing...🤦
+ 1
I don't understand...
0
Still the same issues...