Starting from:

$30

INST326-Exercise Appointment Class Solved

 self
name, a string indicating the name of the appointment (for example, "Sales brunch").
start, a tuple consisting of two integers representing the start time of the appointment. The first integer represents an hour in 24-hour time; the second integer represents a number of minutes. For example, the tuple (10, 30) would represent 10:30 am.
end, a tuple similar to start representing the end time of the appointment.
 The init() method should create attributes name, start, and end, and use them to store the information from the parameters.

 overlaps() method

 Define an overlaps() method with two parameters, self and other, where other is another Appointment object.

 This method should return True if self and other overlap and False if they do not. Be sure to return a boolean value rather than a string.

 Note that two appointments overlap if

 The start time of one appointment occurs between the start and end times of the other appointment (including if the start times are equal), OR
The end time of one appointment occurs between the start and end times of the other appointment (including if the end times are equal)
 Docstrings
 Write a docstring for your class that documents the purpose of the class as well as the purpose and expected data type of each attribute.
For each of the methods you wrote, write a docstring that documents the purpose of the method as well as the purpose and expected data type of each parameter other than self (you never need to document self in a docstring). If your document returns a value, document that. If your document has side effects, such as modifying attributes or writing to standard output, document those as well.
Be sure your docstrings are the first statement in the class or method they document. Improperly positioned docstrings are not recognized as docstrings by Python.

More products