+ 3
Is there anything wrong here?
I am trying to complete a project named Balanced Parenthesis (You cab find it in Python Data Structures). The output shows me that everything is ok, except the last test case (It is hidden). How can I know where did I wrong? This is my code for the project: def balanced(): #your code goes here bal = str(input()) for i in range(len(bal)): if bal.count("(") == bal.count(")"): return True else: return False print(balanced())
2 Answers
+ 5
Some wrong cases:
)))(((
)(((()))
)(
())(
All of the above is True according to your program.
+ 2
CarrieForle Thank you very much!
Hot today
I have made a calculator in which my % (Percentage) not work correctly for 100%50 or 100%20.
2 Votes
Python palindrome challenge.
1 Votes
Java
0 Votes
Number of Ones ( C++ ) question!
1 Votes