You are viewing a single comment's thread. Return to all comments →
x_and_k = input() x = x_and_k[0] k = x_and_k[1::] x = int(x) k = int(k) p = input()
x = str(x)
polynomial = p.replace("x",x) polynomial = polynomial.strip().lower()
answer = eval(polynomial) if answer == k: print(True) else: print(False)
Seems like cookies are disabled on this browser, please enable them to open this website
Input()
You are viewing a single comment's thread. Return to all comments →
x_and_k = input() x = x_and_k[0] k = x_and_k[1::] x = int(x) k = int(k) p = input()
x = str(x)
polynomial = p.replace("x",x) polynomial = polynomial.strip().lower()
answer = eval(polynomial) if answer == k: print(True) else: print(False)