Untitled

mail@pastecode.io avatar
unknown
python
3 years ago
285 B
6
Indexable
Never
class Student:
 def __init__(self, n):
 self.n=n
class Stu(Student):
 def __init__(self, n):
 Student.__init__(self, n)
 def method1(self):
 p=1
 while self.n>0:
 p=p*(self.n%10)
 self.n=self.n//10
 print("product=", p, sep='')
n=int(input("n="))
ob=Stu(n)
ob.method1()