Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save AakashCode12/689f76b40d30ae994168e3ecf3a29c19 to your computer and use it in GitHub Desktop.
Save AakashCode12/689f76b40d30ae994168e3ecf3a29c19 to your computer and use it in GitHub Desktop.
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