Friday, 14 February 2014

SLOG # 4: Week 6



   This week, I spend most of the time finalizing my assignment 1 files and handed in the required files on time knowing that it is due Thursday night. What still bothers me right now is realizing how sensitive pep8.py can be towards white spacing.  Although I managed to complete the assignment on time, I spent large amount of times over the weeks to understand what we are asked to do in some of the steps and analyzing how recursion will be used to move cheeses. 

   In the lab this week, we dealt with writing functions that do not use comprehensions, zip, and filter. Our goal was to write functions that would do the same as the function with comprehensions, zip, and filter, but without using them. The only difficulties I had is to understand how these comprehensions, zips, and filters were used, but the part where requires us rewriting the functions was easily done once I read over how the functions were used. Functions such as any(iterable), all(iterable), and filter(function, iterable) can be used to compress for loops and if statement in one single statement, however using these functions for large nested for looped iterables seems rather unnecessary since a normal iteration through the nested for loops would do just the same. 

   During this week’s lectures, we learned about trees. I learned that a tree is defined containing nodes that have a specific value as well as reference to nodes that serve as the children of that node. The node at the very top that link down to all other nodes below it is known as the ‘root’. It is the only node in the tree that does not have a parent. A root can be a single node (a leaf) or be parent of some nodes where the nodes cannot be parent of its predecessors. Because a tree exhibits a recursive structure, tree’s value can be manipulated and traced by means of recursion. 

   This week was a fairly busy week. Just from the assignment alone I had realized I need to start practice more often if I ever want to do well in this course and become a better programmer.

No comments:

Post a Comment