+ 1
Intermediate Python Dictionary Functions
I can get 4/6 tests passed, however, I am not sure what I am doing wrong here. The code is supposed to take the country name as input and output the corresponding key. If the country is not present, it is supposed to print 'Not Found'. Here is my code: data = { 'Singapore': 1, 'Ireland': 6, 'United Kingdom': 7, 'Germany': 27, 'Armenia': 34, 'United States': 17, 'Canada': 9, 'Italy': 74 } print(data.get(input(), 'Not Found'))
2 Answers
+ 6
Hi Josh!
We don't see any error in your code. So, we can assume that the problem is in output string "Not Found". Please double check it's in a correct format. Upper , lower cases matter.
+ 3
if has to be "Not found"