+ 1
I don't know why but the below code for balancing parenthesis is showing "False" for input "(())". Suggest me what's wrong.
4 Respuestas
+ 2
Change the break into a continue in line 24
+ 3
Also, FYI, this whole part of your code;
if len(a) > 0:
print('False')
elif len(a) == 0:
print('True')
else:
print('False')
Can be reduced to just;
print(len(a) == 0)
+ 2
Learn about indentation for python. It matters lot in python.
you mainly have lot of indentation problem
+ 1
Thank you sir. You are great