Category: Python

  • Fun with Python scoping rules

    Let’s say I want to try something on a list in Python.  While I usually like to call my test list objects “mylist”, I sometimes forget, and create a variable named “list”: list = [‘a’, ‘b’, ‘c’] If you’re like me, then you might not immediately notice that you’ve just defined a variable whose name…

    Read more