Sunday, 9 February 2014

Week 5 – Stools, names, tracing

    This week’s lectures were a little unusual to me. The professor went over assignment one with us and helped us understand it. We spent an entire lecture just figuring out the requirements of the assignment and asking about difficulties we had with it. This gave me a better understanding of the assignment even though I had not started it at that point. In lecture we also learned about scopes and namespaces. Python looks for names in the following order: local, nonlocal, global and then built-in names. I never knew that we can have two of the same names in different functions, so that was pretty cool to learn! We also looked back at tracing a simple recursive function as further practice to strengthen our skills in recursion. We are told not to trace too far. Once you know the answer to something, just plug it in. It saves a lot of time for doing other things.

    Tutorials this week went smoothly just like last week’s tutorial. I was able to apply my newly attained knowledge to all of the problems presented in this week’s lab. Tracing the recursive functions wasn’t really challenging task for me but it provided me some good practice. However, writing the recursive functions was a much more difficult task for me. It was not impossible to do though; it simply took time and a lot of thought and effort. My partner assisted me with any difficulties I encountered while writing the recursive functions.
            
    Overall with the material covered this week I am fairly confident. I’m completely confident with the names and tracing portion. I will still however need to practice recursion a bit more to be fully confident with it. I feel like my achievement this week was achieved in the lab. I was able to make a recursive function to make a deep copy of a list. It felt nice knowing that I was able to rebuild one of the built in functions in python.

    I started the assignment on Thursday and was able to complete it on Saturday night. The first few steps were easy to understand and implement. The difficulty came when I had to make a recursive function for the four stools problem. That took me a couple hours but I was able to complete it and it felt great! I also did the bonus problem just to get some insurance points if something goes wrong with one of my functions.  

No comments:

Post a Comment