Instructions

The Egg classA type of "bundle'' of values. can be used to create categories for eggs. For example, a "Large" egg should have mass in the range from 56 to 62 grams, so that 56 is the lowest mass and 62 is the highest mass possible for this category.

Using the provided classA type of "bundle'' of values. definition and docstringInformation (in a string) stored with a function., create methodsA function associated with a class. __init__ and __str__.

Note:

Hints:

  • Make sure to define the method inside the class definition.

Add to your methodsA function associated with a class. for the classA type of "bundle'' of values. Egg by creating the methodA function associated with a class. is_size, where egg_type.is_size(num) is True if an egg of mass num is of the category egg_type and False otherwise.

Note:

Hint:

  • Remember that the object itself is the first parameter for every method.

Using the provided classA type of "bundle'' of values. definition and methodsA function associated with a class., create a new methodA function associated with a class. aligned such that for objects circ_1 and circ_2, circ_1.aligned(circ_2) is True if circ_1 and circ_2 share the same x and y coordinates and False otherwise.

Note:

Hints:

  • Make sure to define the method inside the class definition.

Now add a methodA function associated with a class. bigger such that circ_1.bigger(circ_2) is True if circ_1 is bigger than circ_2 and False otherwise.

Note:

Hints:

  • undefined

Finally, add a methodA function associated with a class. is_colour such that circ_1.is_colour(col) is True if the colour of circ_1 is col and False otherwise.

Note:

Hints:

  • undefined

Using the Time classA type of "bundle'' of values. defined earlier, create a new methodA function associated with a class. safe which determines whether the values of the attributes are integers in the correct ranges. If a type is wrong the methodA function associated with a class. should produce "Incorrect type", if the types are correct but the hour value is an integer out of range the methodA function associated with a class. should produce "Hour out of range", and if the types are correct and the hour value is in range but the minute value is an integer out of range the methodA function associated with a class. should produce "Minute out of range". If the values are correct, the methodA function associated with a class. should produce "Safe".

Note:

Hint:

  • Make sure to define the method inside the class definition.

Now add a methodA function associated with a class. elapsed such that one.elapsed(two) returns the number of minutes that have passed between one and two, where two is a time later in the day.

Note:

Hint:

  • Make sure to handle the case in which one.minute is greater than two.minute.

Again using the same classA type of "bundle'' of values., create a methodA function associated with a class. overlap where one.overlap(two, three) returns True if (1) one is equal to either two or three or (2) two is earlier than one and one is earlier than three.

You might wish to use the method earlier_time which has been provided for you. You might consider writing a helper function that determines if two times are equal and another helper function function that determines if one time is earlier than another.

Note:

Hint:

  • Make sure to use the correct syntax for calling a method.
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX