Update example code for Python 3