Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- line = 'a*(b+c*-a)*0%d'
- signs = {'*' : ' and ',
- '+' : ' or ',
- '-' : ' not ',
- '%' : ' | '}
- a = 1
- b = 0
- c = 1
- d = 1
- fline = ''
- for ch in line:
- if ch in signs:
- ch = signs[ch]
- fline+=ch
- print(eval(fline))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement