I am a Python newbie and I came across this exercise of checking whether or not the simple brackets \"(\", \")\" in a given string are matched evenly.
I have seen ex
The simplest code ever!!
def checkpar(x): while len(''.join([e for e in x if e in "()"]).split('()'))>1: x=''.join(x.split('()')) return not x