Friday, 7 February 2014

Week 5: Namespaces

    This week I learned about namespaces and the order that python searches for names; first local (within the function body starting at the innermost function - in cases that there are function within functions), then nonlocal then global and finally it looks for built-in names. During lecture, I had practice with predicting where python looks for names being called. I’ve learned to bind and rebind variables using statements like ‘nonlocal’ and how to unbind using ‘del something’ which erases the link between object and attribute. In this week’s lab, I practiced tracing recursion and writing two recursive functions that offered more insight on the process of recursion. 

No comments:

Post a Comment