There is no such name in Python 3, no. You are trying to run Python 2 code in Python 3. In Python 3, unicode been renamed str .
However, you can completely remove the unicode() call; open() creates a file object that already decodes Unicode data for you. You probably want to say which codec to use explicitly:
fileMain = open("dictionary_15k.txt", "r", encoding="utf-8") for line1 in fileMain: dictWords.append(line1.strip())
You can switch to Python 2 if your tutorial is written with this version in mind.
source share