Python Forum

Full Version: Showing Indentetion Problem
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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)
Like this?

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
			pass
	if ((a==True) and (b==True) and (c==True)):
		return True
	else:
		return False
	
	
result = array_check(mylist)
print(result)