Dictionary function | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Dictionary function

Please the last line has been my problem Please how do I go about it data = { 'Singapore': 1, 'Ireland': 6, 'United Kingdom': 7, 'Germany': 27, 'Armenia': 34, 'United States': 17, 'Canada': 9, 'Italy': 74 } country = input() if country in data: print(data[country]) print(data.get(input(), "Not Found"))

2nd Mar 2022, 9:52 AM
Chukwuka Francisca Makuochukwu
Chukwuka Francisca Makuochukwu - avatar
1 Answer
0
Yeah. As long as the the country doesn't exist in data. It should be considered as Not found
2nd Mar 2022, 10:01 AM
Chukwuka Francisca Makuochukwu
Chukwuka Francisca Makuochukwu - avatar