This week, we learned about new topic, recursion. Recursions are basically functions that calls itself. By doing that, the function can do things like, for example, calculating sum of numbers in list when there are lists in list or more list ore list with depth of greater than 2. Since the function calls itself, whenever there is a list in list, we call the function on that list so that it calculates the sum of the numbers in the list, or if there is another list, calls the function again and repeat. In the end, when it calculates all the sums, it just returns the total sum as we wanted. Personally this is by far the most entertaining topic to learn. It was a lot easier to understand than other previous topics we learned in the past and I feel very confident with this topic.
The lab and quiz this week went pretty well, I could fully understand all the things I had to do. Hopefully the result is as good as I expect it to be. On the other hand, the test result was very disappointing. it was a lot lower than I expected. The shortage of time was more of a problem than I expected. But past is a past, I just have to work really hard to earn my marks back.
No comments:
Post a Comment