Sort by

recency

|

556 Discussions

|

  • + 0 comments

    x, k = map(int, input().split())

    poly = input().strip()

    expression.** if eval(poly) == k: print("True") else: print("False")

  • + 0 comments

    For python 3:

    `x, k = map(int, input().split())

    expression = input()

    result = eval(expression, {"x": x})

    print(k==result)`

  • + 0 comments

    x, k = map(int,input().split(" ")) p = input() uppalbalu = eval(p) if uppalbalu == k: print('True') else: print('False')

  • + 0 comments
    #The eval() function in Python is used to evaluate a string as a Python expression. It parses the string and executes it as code within the current environment.
    #Using Pypy 3
    
    x,k = map(int, input().split())
    poly_exp = input() 
    print((eval(poly_exp))==k)    
    
  • + 0 comments
    f = input()
    
    f_r = f.replace("x" , str(x))
    
    print(eval(f_r) == y)