Program stuck in infinite loop
i wrote a bracket checker program in Python and I don't know why it sticks on an infinite loop. I couldn't find an infinite loop in my code. Please don't send a code for bracket checker, only highlight my own codes bug. this is my code: ------------------------------------------------------------------------------------------------------------ string=input("input the phrase you wanna check: ") chars_collector=[] for character in string: chars_collector.append(character) while chars_collector: passed=False for i in range (len(chars_collector)-1): if chars_collector[i]==chars_collector[i+1]: chars_collector[i],chars_collector[i+1]=0,0 passed=True elif passed==False : for zeros in chars_collector: chars_collector=[zeros.pop for zeros in chars_collector if zeros==0] print(chars_collector) break -------------------------------------------------------------------------------------------------------------- ill appreciate if you answer.