Thursday, January 30, 2014

Raising and Catching Exceptions


         During the lab of this week, my partner and I both feel the difficulty of problems in the handout. Firstly, we are confused about the difference between attributes and method.  After the clarification of TA, we are eventually on the right track, but a little behind of other classmates.  At that time, I realized that I do not have a good way for studying CSC148. We have pre-videos in CSC108; thus, it is good for me to know what I will learn in the following week and the videos clearly show the main contents of the course. I never look at outside sources in the last semester. Nevertheless, I am pretty sure that I need to change my study way. Although the professor posts the related information, which is about the learning points we need to know, I still do not pay much attention on them. Now, I realize that I need to seriously read them.
         Before I take a look reading and review the python examples, I even do not understand the handout of exercise this week and do not know how to start the code. Moreover, I search everything confused in the handout such as exception class. Therefor, I read the reading according to Exceptions. I know what is exception and when it is happened. Even if the code has no syntax error, it may cause different types of error when an attempt is made for executing it. Furthermore, I learn how to catch exceptions by using try-except statement and raising our own exception. Actually, this part is not that such difficult. I finish the exercise in a few minutes and pass all the tests. Luckily, it seems that I find a suited way of learning for myself.

Tuesday, January 21, 2014

Object-Oriented Programming

       Python, even other programming languages,  is new for me until last semester. Throughout the learning in CSC108 and the studying in the first three weeks of CSC148, I know that Python is an object-oriented programming. Everything in program is an object and has their type. I learn some basic classes such as int and str, and I also learn how to define my own classes. For Python, the main task is for creating objects, which are the instances of classes, and writing functions. All in all, the most important part in object-oriented programming are objects, which can store the data and working with module. To be honest, finding the bugs is still a difficulty for me and I am not familiar with using methods. Nevertheless, I will keep working and deal with the confusions in a short time.