ezoic

Thursday, February 16, 2017

Another problem using bool

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

looking for a man

 I am a mid aged woman.  I was born in 1980. I do not have any kid. no complicated  dating before . I am looking for a man here for marriage...