In-Class Exercise 5 solution

$13.00

Original Work ?

Download Details:

  • Name: ex5.zip
  • Type: zip
  • Size: 47.71 KB

Category: You will Instantly receive a download link upon Payment||Click Original Work Button for Custom work

Description

5/5 - (1 vote)

Part 1
Create a function which takes as a parameter a list of
datetime s. Have the function print a message when
each of the datetime s in the list are reached in real
world time.
Hints: You don’t need to have the message print on
the exact microsecond; it’s ok if it prints several milliseconds late. You don’t need to setup a user input for
typing in the datetime list; Hardcode a datetime
list and pass it into your function for testing.
Part 2
Create a class whose objects can be compared. The class
should have two integer attributes. When two objects of
this class are compared using > , the ”larger” of the
two should be the one whose first integer is larger. If it’s
a tie, the one with the larger second integer should be
considered the ”larger” object. Keep in mind __gt__
has to return a single Boolean, but that doesn’t mean it
needs to be a one line function.
1