trial error method python
def trial_error_method(P:int):
result = 5*P+2
if result == 17:
return True
else:
return False
def trial_error_method2(M:int):
result = 3*M-14
if result == 4:
return True
else:
return False
num = 1
found = False
while found == False:
found = trial_error_method(num)
if found == True:
break
num += 1
num2 = 1
while True:
found2 = trial_error_method2(num2)
if found2 == True:
break
num2 += 1
print(num)
print(num2)