Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- list_index_deg = []
- for i in range(len(str) ):
- if str[i] == '^':
- list_index_deg.append(i)
- for index in list_index_deg:
- if str[index - 1].islower():
- expression = str[index - 1]
- if str[index - 1] == ')':
- count = 0
- expression = ''
- copy_index = index
- while count >= 0 and copy_index >= 0:
- if str[copy_index] == ')':
- count += 1
- if str[copy_index] == '(':
- count -= 1
- expression = str[copy_index] + expression
- copy_index -= 1
- expression = expression[:-1]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement