2nd Semester Intro to Computer Science

Do Now 7.03

In your Console

Type the following

class Time(object):
  def __init__(self, hour, minute, second):
        self.hour = hour
        self.minute = minute
        self.second = second

time1 = Time(5, 32, 0)
time2 = Time(23, 11, 11)

print(time1)
print(time2)

In your Notebook

Respond to the following

  1. Based on what is output, how can you tell the difference between time1 and time2?
  2. What happens if you try to add time1 add time2?

Edit this page Report an issue