Sep-19-2018, 07:43 PM
mylist = [1,2,4,2,1,1,3,1,4,4,5]
def array_check(list):
for item in list:
if item==1:
a=True
elif item==2:
b=True
elif item==3:
c=True
else:
#nothing to do.
if ((a==True) and (b==True) and (c==True)):
return True
else:
return False
result = array_check(mylist)
print(result)
def array_check(list):
for item in list:
if item==1:
a=True
elif item==2:
b=True
elif item==3:
c=True
else:
#nothing to do.
if ((a==True) and (b==True) and (c==True)):
return True
else:
return False
result = array_check(mylist)
print(result)