Opening Hours :7AM to 9PM
def __init__(self,list of parameter/no parameters): .... ....In the above syntax init is a Constructor .
def __init__(self): .... ....
def __init__(self,variable1,variable2,...): .... ....
class Factorial: def __init__(self): self.n=int(input("Enter n value")) def fact(self): x=1 f=1 while(x<=self.n): f=f*x; x=x+1 print(f) if __name__=="__main__": ff=Factorial() ff.fact()
class Factorial: def __init__(self): self.n=int(input("Enter n value")) def fact(self,x,f): while(x<=self.n): f=f*x; x=x+1 print(f) if __name__=="__main__": ff=Factorial() ff.fact(1,1)
class Factorial: def __init__(self): self.n=int(input("Enter n value")) def fact(self): x=1 f=1 while(x<=self.n): f=f*x; x=x+1 return(f) if __name__=="__main__": ff=Factorial() s=ff.fact() print(s)
class Factorial: def __init__(self): self.n=int(input("Enter n value")) def fact(self,x,f): while(x<=self.n): f=f*x; x=x+1 return(f) if __name__=="__main__": ff=Factorial() s=ff.fact(1,1) print(s)
class Factorial: def __init__(self,m): self.n=m def fact(self): x=1 f=1 while(x<=self.n): f=f*x; x=x+1 print(f) if __name__=="__main__": m=int(input("Enter m value")) ff=Factorial(m) ff.fact()
class Factorial: def __init__(self,m): self.n=m def fact(self,x,f): while(x<=self.n): f=f*x; x=x+1 print(f) if __name__=="__main__": m=int(input("Enter m value")) ff=Factorial(m) ff.fact(1,1)
class Factorial: def __init__(self,m): self.n=m def fact(self): x=1 f=1 while(x<=self.n): f=f*x; x=x+1 return(f) if __name__=="__main__": m=int(input("Enter m value")) ff=Factorial(m) s=ff.fact() print(s)
class Factorial: def __init__(self,m): self.n=m def fact(self,x,f): while(x<=self.n): f=f*x; x=x+1 return(f) if __name__=="__main__": m=int(input("Enter m value")) ff=Factorial(m) s=ff.fact(1,1) print(s)