File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed
pygorithm/data_structures Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -95,7 +95,7 @@ def __is_operand(char):
95
95
# OLD VERSION
96
96
# return ord(char) >= ord('a') and ord(char) <= ord('z') \
97
97
# or ord(char) >= ord('A') and ord(char) <= ord('Z')
98
- return True if ord (char ) in [ord (c ) for c in list ( ascii_letters ) ] else False
98
+ return True if ord (char ) in [ord (c ) for c in ascii_letters ] else False
99
99
100
100
@staticmethod
101
101
def __precedence (char ):
@@ -127,7 +127,8 @@ def infix_to_postfix(self):
127
127
postfix .append (top_operator )
128
128
top_operator = self .my_stack .pop ()
129
129
else :
130
- while not self .my_stack .is_empty () and self .__precedence (self .expression [i ] <= self .__precedence (self .my_stack .peek ())):
130
+ while not self .my_stack .is_empty () \
131
+ and self .__precedence (self .expression [i ] <= self .__precedence (self .my_stack .peek ())):
131
132
postfix .append (self .my_stack .pop ())
132
133
self .my_stack .push (self .expression [i ])
133
134
You can’t perform that action at this time.
0 commit comments