Make 2048.py compatible with both Python 2 and Python 3.