2014年2月1日星期六

exception and subclass

    This week we did E2 which is about exception. I know how to create a exception to prevent our program from crashing because of some certain code. The format of creating an exception is try...except clause. Below the try: clause, write the code possibly will crash when run the program and below the except: clause, write the result we want to produce or the way we want to fix those exceptions. Also, I have learnt how to raise exception defined by our ourselves and how to create a subclass. But there is still something I don't get about exception and subclass and I will try to figure out in the next few days. There is one more thing I have no idea. During the lab this week, both my partner and I don't know how write the  unittest and maybe we should do a little bit works on it because unittest is the content we have already been introduced in last semester in CSC108 so we are supposed to understand and apply it to our program.