+ 1
Recursive fonction that identify the position of an number #but it doesn't work
def position (L,x): if L=[]: return -1 elif L[0]!=x : return position(L[1:],x)
2 Antworten
+ 1
yeah i corrected it but still not working! :(
+ 5
What happens when you try? Do you get an error message? Undesired output?
I'm not sure what all you're doing, and I'm no Python expert, but shouldn't your first expression have a == instead of =? L==[]: