Hi again! :)
The tip of the iceberg is what I would probably call this week. The little bit of recursion that we have learned so far, we are putting into use. In the lab this week, pretty much every single exercise was recursion-based.
In my opinion, I thought it was rather exhilarating when I finally figured out how to code something, when I finally grasped the idea and the light bulb flicked on in my brain.
From what I have come across in this lab and the lectures, I will share what I think is the key to recursion for those of you who are reading this and feel like you're struggling with it (so far...I'm pretty noob too, but this is from noob to noob ;) ). I feel like the one most essential thing in recursion is to always call the function itself in its own function body, and it will call and call again until it reaches a base case, in which case the result will be evaluated. I felt like once I grasped that detail, everything kind of fell into place. An epiphany if you must.
Anyway, I'll edit this again after Wednesday's lecture and after doing some work on assignment 1. :)
EDIT: Well the global, local and nonlocal stuff was confusing, going to go play around with the example to try to understand it. Although I found the parent class things to be relatively easy to understand.
P.S. List comprehensions save lives.
SEE YOU NEXT WEEK!
Nice read and your recursion definition is spot on - that's exactly how I thought of it when I first learned recursion!
ReplyDeleteP.S. I've linked your Slog in mine (if you don't mind :-] )
Aww thank you, dear. :) You're too nice.
DeleteI was actually thinking maybe I ramble too much sometimes, but it's great to know people enjoy reading it.
P.S. I don't mind at all. :D!