I need to write a class syntax, to be able to add days, months.. to a date. currently I only have this:
class Date:
def __init__(self, day=1, month=1, year=2015):
self.day = day
self.mon = month
self.year = year
def printUS(self):
print self.mon , "/" , self.day , "/" , self.year
def printUK(self):
print self.day , "." , self.mon , "." , str(self.year)[2:]
def AddDay(self,n=1):
I am confused how to write the last function in a way to add days for each month correctly not to exceed the days of month or year. I rather not use any other modules, since I have not learned them at all. I don't have more than a month basic programming experience,and never had previous experience before.