0
My test case 5 in python intermediate 4.2 lesson is not working, but all the other test cases are correct.
Not able to proceed forward,although I think my code is correct. Can someone help?
6 ответов
+ 4
Please show your code so we can tell you how to correct it. Without seeing your code we can't see what the issue is.
+ 3
Read the task description again: "Not Found" with capital "F"
+ 1
It worked....thanks a lot!!!!😃
0
contacts=[
('James', 42)
('Amy', 24)
('John', 31)
('Amanda', 63)
('Bob', 18)
]
name=input()
for person,age in contacts:
if name==person:
print( person, "is", age)
break
else:
print("Not found")
This was the first code I used but it didn't satisfy test case 5 which is locked.
0
Another one that I tried:
name=input()
for x in contacts:
if name in x:
print(str(x[0])+" is " + str(x[1]))
else:
print("Not found")