# A client program that deals with dates. # Fourth version, to accompany Date class with properties. from Date import * def main(): # create three Date objects d1 = Date(9, 19) d2 = Date(7, 31) # advance each date and print its state print("d1 month is", d1.month) print("d1 day is", d1.day) # try to change month property value (will raise error) try: d1.month = 13 print("d1 month is", d1.month) except ValueError: print("Oops, can't set month to 13") print("d2 is", d2) d1.advance() d2.advance() print("d1 is", d1) print("d2 is", d2) main()