Untitled
Anonymous
python
05/17/2021 10:21 AM
380 B
24
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...