0

National economic freedom ,in intermediate Python (dictionaries ) 5,6 test cases are not executed ,help me to solve

a= input () If a in data: Print(data.get(a)) Else: Print('not found')

29th Sep 2021, 8:54 AM
Bheemu Mallika
Bheemu Mallika - avatar
4 odpowiedzi
+ 3
some errors at your code. Like If,Print,Else, Need indentation also. Be careful ! python is case sensitive. I modified it,plz test and check it a=input() if a in data: print (data.get(a)) else: print ("Not found") plz write according to problem's given, Write "Not found". Actually writing "not found" is not wrong, but it can't pass tests in problem .Coz their desired output is "Not found" ,N with capital letter.
29th Sep 2021, 9:39 AM
Myo Thuzar
Myo Thuzar - avatar
+ 3
But it's python print(data.get(input(),"Not found"))
29th Sep 2021, 9:55 AM
Simba
Simba - avatar
+ 1
Thank you
29th Sep 2021, 10:13 AM
Bheemu Mallika
Bheemu Mallika - avatar
0
Given code is data = { 'singapore':1, 'ireland:6, 'united Kingdom':7, 'Germany':27, 'america:34, 'united states':17, 'canada':9, 'italy':74 }
29th Sep 2021, 9:01 AM
Bheemu Mallika
Bheemu Mallika - avatar