s = "{[]}()"
def parenthesis(s):
	openp = []
	open = "{[("
	index = 0
	while(index < (len(s))):
		print(s[index])
		if s[index] in open:
			openp.append(s[index])
		else:
			if (openp == []):
				return False
			else:
				popped = openp.pop()
				if popped == "(" and s[index] == ")":
					pass
				elif popped == "{" and s[index] == "}":
					pass
				elif popped == "[" and s[index] == "]":
					pass
				else:
					return False
		
		index += 1
	
	if openp == []:
		return True
	return False

print(parenthesis(s))
c6753bb85e25528d6946cf789c5ada5b299e2ebb
<mask token>

<mask token>


def parenthesis(s):
    openp = []
    open = '{[('
    index = 0
    while index < len(s):
        print(s[index])
        if s[index] in open:
            openp.append(s[index])
        elif openp == []:
            return False
        else:
            popped = openp.pop()
            if popped == '(' and s[index] == ')':
                pass
            elif popped == '{' and s[index] == '}':
                pass
            elif popped == '[' and s[index] == ']':
                pass
            else:
                return False
        index += 1
    if openp == []:
        return True
    return False


<mask token>

<mask token>


def parenthesis(s):
    openp = []
    open = '{[('
    index = 0
    while index < len(s):
        print(s[index])
        if s[index] in open:
            openp.append(s[index])
        elif openp == []:
            return False
        else:
            popped = openp.pop()
            if popped == '(' and s[index] == ')':
                pass
            elif popped == '{' and s[index] == '}':
                pass
            elif popped == '[' and s[index] == ']':
                pass
            else:
                return False
        index += 1
    if openp == []:
        return True
    return False


print(parenthesis(s))

s = '{[]}()'


def parenthesis(s):
    openp = []
    open = '{[('
    index = 0
    while index < len(s):
        print(s[index])
        if s[index] in open:
            openp.append(s[index])
        elif openp == []:
            return False
        else:
            popped = openp.pop()
            if popped == '(' and s[index] == ')':
                pass
            elif popped == '{' and s[index] == '}':
                pass
            elif popped == '[' and s[index] == ']':
                pass
            else:
                return False
        index += 1
    if openp == []:
        return True
    return False


print(parenthesis(s))

s = "{[]}()"
def parenthesis(s):
	openp = []
	open = "{[("
	index = 0
	while(index < (len(s))):
		print(s[index])
		if s[index] in open:
			openp.append(s[index])
		else:
			if (openp == []):
				return False
			else:
				popped = openp.pop()
				if popped == "(" and s[index] == ")":
					pass
				elif popped == "{" and s[index] == "}":
					pass
				elif popped == "[" and s[index] == "]":
					pass
				else:
					return False
		
		index += 1
	
	if openp == []:
		return True
	return False

print(parenthesis(s))