Untitled
unknown
python
4 years ago
285 B
13
Indexable
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()
Editor is loading...