Python 2.x has ASCII as its default encoding, while Python 3.x uses UTF-8. This means that in Python 2.x, if you want to use non-ASCII characters in your code, you need to define the encoding at the beginning of the file with the following comment: '# -*- coding: utf-8 -*-'. In Python 3.x, this is no longer necessary because it already uses UTF-8 as its default encoding.