Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

The assignment is to write a class called data. A Date object is intented to rep

ID: 3782913 • Letter: T

Question

The assignment is to write a class called data. A Date object is intented to represent a particuar date's month, day and year. It should be represented as an int.

---Write a constructor. You should assume that your constructor will be passed 3 parameters, representing the month, day, and year to be stored in the object. Each is an integer. For example:

>>> mlk_day = Date(1, 16, 2017)

>>> revolution = Date(7, 4, 1776)

>>> ny_eve = Date(12, 31, 2016)

Remember that when defining a constructor, we will always call its first parameter self, which refers to the object which is created.

Python 2.7.13

Explanation / Answer

class Data: def __init__(self, month, day, year): """ :param month: :param day: :param year: :return: """ self.month = month self.year = year; self.day = day s = Data(1,12,2017)

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote