Last active
August 4, 2020 18:33
-
-
Save AakashCode12/689f76b40d30ae994168e3ecf3a29c19 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import re | |
print("please add spaces b/w each term") | |
line=input() | |
splitted_line=line.split( ) | |
#stack jo bech me hota hai in table while solving | |
stack=list() | |
#list to be printed | |
num_print=list() | |
operators=['+','-','*','/','^','&','|','(',')','{','}','[',']'] | |
for x in splitted_line: | |
if x in operators : | |
stack.append(x) | |
else : | |
num_print.append(x) | |
print(stack) | |
print(num_print) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment