Unable to excute the output

x=int(input(“please enter the value:”))
n=int(input(“please enter nth power :”))

class Powerfunction:
def init(self,x,n):
self.x=x
self.N=n
def powernum(self):
k=self.x**self.N
print(k)
p1=Powerfunction(x,n)

p1.powernum

1 Like

@kantamaneni024
Just use normal quotes instead of italic and it is working fine. I have checked using Google colab

1 Like

@kantamaneni024

There are lot of mistakes in your code

at line 1 and 2 : use correct quotes.
at line 5: define init properly , it should be init
at line 12 : call the function properly instead of powernum use powernum()

Please rectify these things and your code will run successfully.

1 Like

thanks it working, line 5 is copy paste error , apart from that remaining i correted

2 Likes