¡Nuevo curso! ¡Todo programador debería aprender IA Generativa!
Prueba una lección gratuita0
Practice 4.2 of intermediate python
Could you help me to fix this could for the practice? The last test of it said it's wrong but it doesn't show
4 Respuestas
0
Mahdiye Rahimnavaz
Check spelling of 'found'
+ 1
Don't post multiple time and where is your code?
+ 1
Oh sorry I fix it
this is my code:
contacts = [
('James', 42),
('Amy', 24),
('John', 31),
('Amanda', 63),
('Bob', 18)
]
name = input()
num = 0
for i in range(len(contacts)):
if name != contacts[i][0]:
num += 1
else:
break
if num < 5:
print (name +" is "+str(contacts[num][1]))
else:
print ("Not found")
+ 1
OH It was F
Tnx