Reading week is over! I honestly wish it was longer, but at least I was able to catch up on sleep.
We started talking about recursion this week. Recursion is a technique in which a method is used within itself. The method is executed many times times (within itself) in order to keep changing certain data. Recursion can be used to make beautiful visuals such as fractals. To have a method work within a method is pretty mind blowing!
We also learned about the one liner version of an if else statement. Here's an example below:
>>> z = 100
>>> z = 10 if z == 100 else print('banana')
>>> z
10
I found the syntax of the one liner version to be confusing at first. It took me a lot of typing in python shell to figure it out/understand it. The above statement literally means: I want z to equal 10 if the expression z == 100 is true, or else print the string 'banana'.
Friday, 26 February 2016
Wednesday, 10 February 2016
CSC148 Week 5
I tried the sample test questions that our professor gave us last week and question #3 caught me off guard. So I decided that I should review superclasses and subclasses again during the weekend. Good thing I did too, since one of the three questions on our first test involved superclasses and subclasses again.
In fact, the first test was just earlier today! I thought the it was pretty fair, it covered a fair region of what we learned in the past 5 weeks, but I would have loved to have an extra 10 more minutes to finish it confidently. I felt like the classes I had to create on the test were poorly designed since I was under such a short time limit. At least the test didn't have any questions based on LinkedLists. That would have made the test way worse.
Anyway, reading week starts this week, I'm pretty sure almost every university student has been looking forward to this week for a long time. Happy reading week!
In fact, the first test was just earlier today! I thought the it was pretty fair, it covered a fair region of what we learned in the past 5 weeks, but I would have loved to have an extra 10 more minutes to finish it confidently. I felt like the classes I had to create on the test were poorly designed since I was under such a short time limit. At least the test didn't have any questions based on LinkedLists. That would have made the test way worse.
Anyway, reading week starts this week, I'm pretty sure almost every university student has been looking forward to this week for a long time. Happy reading week!
Saturday, 6 February 2016
CSC148 Week 4
I realized that this course is way more fast paced than CSC108 and that I have to change my study habits if I want to do really well in this course. I didn't do as good as I wanted on Week 2's quiz... thankfully the lowest quiz is dropped!
During this week I learned about the stack class, which is like a list. When you add an item to a stack, it is added to the end of a it, When you remove an item from a stack, the item at the end it taken out. It's a really simple class. It includes __init__, __eq__, __str__, remove and add methods.
During the lab, we focused on stacks. We had to create a queue class. A queue is slightly different from a stack, when it has to remove an item it instead removes it from the beginning of the queue. We also had to create unittests for both the stack and queue class. I find unittest complicated and confusing for me, so I'm going to review the topic this weekend.
During the lab, we focused on stacks. We had to create a queue class. A queue is slightly different from a stack, when it has to remove an item it instead removes it from the beginning of the queue. We also had to create unittests for both the stack and queue class. I find unittest complicated and confusing for me, so I'm going to review the topic this weekend.
Subscribe to:
Posts (Atom)