0
Need help (сбалансированные скобки)
def balanced(expression): a=0 b=0 for i in expression: if i == '(': a+=1 b+=2 elif i == ')': a-=1 b+=2 if a == 0 and b!=0: return True else: return False print(balanced(input())) 7 test can't get agree
2 Answers
+ 1
Reverso Context balance (data structure)
0
What is this code's objective?