Below we have the Date class. We have specified two attributes the day and the month in its __init__ method:
class Date:
def __init__(self, day, month):
self.day = day
self.month = month
Based on these attributes, we want to create a new one, the date that will represent the day and the month string values divided by a slash. For example, for 14 and 05 we should get 14/05.
This attribute could have been set in the initializer, too. In this case, however, if we were to change the day value to 15, for example, we would still get 14/05. What we actually want to get is the following:
date_obj = Date('14', '05')
print(date_obj.date) # 14/05
date_obj.day = '15'
print(date_obj.date) # 15/05
Write the body of the date method that will return the values of the day and the month separated by a slash and make it accessible as an attribute by placing the correct decorator name above. Note that you do not have to take input or create new class instances.
NOTE: in this case, both day and month are strings, so they can have leading zeros.