Tuesday, 8 March 2016

Week 7
Recursion

As a new comer to the Python programme, surprisingly, I enjoyed the topic on recursion! Recursion is a way of programming or coding a problem, in which a function calls itself one or more times in its body. Usually it returns the return value of this function call, where there are two cases, a base case and a general case (the recursive part). The amazing part is that the loop seems like an infinite one but it will eventually ended. The recursive code actually break down the problem from the big questions into smaller and smaller one.

To see professor writing out recursion codes in the lecture was not hard at all to understand it, even seemed really easy to me in some ways. However, in my turn on writing codes by my self, I struggled and spent a lot of time figuring out what should i put. By trying to trace along with the codes, this helped me a lot on understanding how a recursive code works, and thus gives me ideas on how should i write my codes. And as always, practices more and get familiar with the recursion!

I love how we do a lot of example on math functions like the factorial. As a mathematic specialist, this gives me tons of room to think about other functions as well, really interesting! I can see how recursion can have a really useful applications! After all, I was really enjoyed about these weeks lectures and topics, learned a lot and had so much fun through it.

Rebecca

No comments:

Post a Comment