Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- a = '-(¬ДЕЛ(x, А) ∧ ДЕЛ(x, 6)) v ¬ДЕЛ(x, 3)'
- def test_del(x,y):
- return x % y == 0
- a = a.replace('v',' or ')
- a = a.replace('∨',' or ')
- a = a.replace('^',' and ')
- a = a.replace('∧',' and ')
- a = a.replace('-',' not ')
- a = a.replace('¬',' not ')
- a = a.replace('ДЕЛ',' test_del')
- a = a.replace('А','A')
- a = ' '.join([x for x in a.split(' ') if x])
- print(a)
- for A in range(1,100):
- res = True
- for x in range(0,200):
- f = eval(a)
- if not f:
- #print(A,x,f)
- res = False
- break
- if res:
- print('Возможно это ответ: ', A)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement