0
[solved]What's wrong with this ?
3 Antworten
+ 1
"m" is created inside your evaluate() function. This means that it can only be "seen" inside that function. (In more technical language, it has "local scope".) To get m to be visible outside the function, you can return its value at the end of it.
def evaluate(x,y):
for i in range(len(y)):
if x[i]==y[i]:
a=a.append(i)
i +=1
elif x[i]== "0":
c=c.append(i)
i +=1
elif x[i]!=y[i]:
b=b.append(i)
i +=1
m=len(a)*4
return m
m = evaluate(x, y)
print(m)
0
Thank you....!!