Answer the question
In order to leave comments, you need to log in
I can't figure out what exactly is the syntax error?
If anyone needs a task, then here:
Denote by DEL(n,m) the statement "a natural number n is divisible without
remainder by a natural number m". For what largest natural number A is the
formula
¬DIV(x, A) → (DIV(x, 6) → ¬DIV(x, 9))
identically true (that is, it takes the value 1 for any natural
value of the variable x)?
def Del(n, m):
if n % m == 0:
return True
else:
return False
for A in range(1, 10000):
flag = True
for x in range(1, 10000):
if ( not(Del(x,A)) <= (Del(x,6) <= not(Del(x,9))) ) == False:
flag = False
if flag == True:
print(A)
Answer the question
In order to leave comments, you need to log in
You need a parenthesis before not:
if ( not(Del(x,A)) <= (Del(x,6) <= (not(Del(x,9)))) ) == False:
if ... == False
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question