Last week’s
exercises were good. Actually, they were pretty great. There’s something
satisfying about doing something recursively and trusting that it works. So,
happily for me, I think I can confidently say that I’m finally comfortable with
recursion. set_depth was exactly six lines of code, which is great because I think the handout mentioned that approximately six lines were optimal? Regardless, I'm pretty happy about how quickly I was able to piece it together; it just felt really good after a semester of being really confused about recursion. I wonder if it's at all possible to shorten set_depth even further, but I don I think I can with the way I've set it up. My leaves_and_internals function could probably have been better, though. I looking through it this week and it just seems so long-winded. I almost want to see other people's code just to see how I could make my own more efficient. I originally tried to write it with a list comprehension, but I think I messed it up, so I ended up doing something else, instead. Perhaps I should try tackling it again.
No comments:
Post a Comment