Ad
Code
Diff
  • import math
    
    def power(num , p):
        # return  round(math.exp(1)**(p*math.log(num)))
        # return 10**(p*math.log(num,10))
        return 2**(p*math.log(num,2))
    • import math
    • def power(num , p):
    • return num**p
    • # return round(math.exp(1)**(p*math.log(num)))
    • # return 10**(p*math.log(num,10))
    • return 2**(p*math.log(num,2))