Skip to content

Commit 5709934

Browse files
fix style
1 parent 822f945 commit 5709934

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

python/codewars/valid_parentheses.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,19 @@
22
# Write a function that takes a string of parentheses, and determines if the order of the parentheses is valid.
33

44
def valid_parentheses(string):
5-
if (string.count('(') != string.count(')')):
5+
if string.count('(') != string.count(')'):
66
return False
77
stack = []
88
for s in string:
9-
if(s == '('):
9+
if s == '(':
1010
stack.append(s)
11-
elif(s == ')'):
11+
elif s == ')':
1212
try:
1313
stack.pop()
1414
except IndexError:
1515
return False
1616

17-
if(len(stack) == 0):
17+
if len(stack) == 0:
1818
return True
1919
else:
2020
return False

0 commit comments

Comments
 (0)