In [1]:
class Time:
    '''시간을 표현 
    속성: hour, minute, second
    '''

In [2]:
help(Time)


Help on class Time in module __main__:

class Time(builtins.object)
 |  시간을 표현 
 |  속성: hour, minute, second
 |  
 |  Data descriptors defined here:
 |  
 |  __dict__
 |      dictionary for instance variables (if defined)
 |  
 |  __weakref__
 |      list of weak references to the object (if defined)


In [3]:
time = Time()
time.hour = 11
time.minute = 59
time.second = 30

In [10]:
time2 = Time()
time2.hour = 8
time2.minute = 12
time2.second = 44

In [11]:
def print_time(time):
    print("%s:%s:%s" % (time.hour, time.minute, time.second))

In [12]:
print_time(time)


11:59:30

In [42]:
def is_after(t1,t2):
    print("{:0>2}{:0>2}{:0>2}".format(t1.hour,t1.minute,t1.second))
    print("{:0>2}{:0>2}{:0>2}".format(t2.hour,t2.minute,t2.second))
    return "{:0>2}{:0>2}{:0>2}".format(t1.hour,t1.minute,t1.second) < "{:0>2}{:0>2}{:0>2}".format(t2.hour,t2.minute,t2.second)

In [43]:
print(is_after(time, time2))v


115930
081244
False

In [ ]: