open the file 'words.txt' in 'ru' mode,"f = open('words.txt', 'rU')"