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
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
@kantamaneni024
Just use normal quotes instead of italic and it is working fine. I have checked using Google colab
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.
thanks it working, line 5 is copy paste error , apart from that remaining i correted