The script:
class what_day:
def __init__(self, mydate):
self.mydate=mydate
month,day,self.year=str.split(self.mydate, '/')
self.month=month.lstrip('0')
self.day=day.lstrip('0')
if(len(self.year)==2):
self.year='19'+self.year
def out(self):
print
self.month,self.day,self.year
def days(self):
days=int(self.month)*30+int(self.day)
return days
#main program
#class
date=what_day('03/02/65')
date.out()
#days
days=date.days()
print 'days=', days
Writing date: 20150514
No comments:
Post a Comment