I have a question, I can not do an exercise in classes and methods.
2 - Create the "Date" class with the attributes: day, month, and year. And create the methods "setarData (receive day, month and year)" and "print (" ex: 03/08/2017 ")". The builder should start on 01/01/1970. USE OPTIONAL PARAMETERS.
The program should start on 1/1/1970 and should print the date that the user entered. Ex: 08/03/2017
Image: link
- UPDATED IMAGE (I can not import the class in the main program): link
What I was able to do, I caught in that part ...:
class Data:
def __init__(self, d = 1, m = 1, a = 1970):
self.dia = d
self.mes = m
self.ano = a
def setarData(self, d = 3, m = 8, a = 2017):
self.dia =
self.mes = m
self.ano = a