testing if an item is in a list, not use in.
class Solution:
def is_member(self, a,x):
bool1=0
for i in range(len(x)):
bool1=bool1+bool(a==x[i])
if bool1==0:
return('False')
if bool1>0:
return('True')
No comments:
Post a Comment