python3.5下运行笨办法学python中习题41报错,麻烦哪位大神帮忙指点,错在哪了

for word in urlopen(WORD_URL).readlines(): WORDS.append(word.strip().decode("utf-8"))这里加上decode("utf-8");other_names = random.sample(WORDS, snippet.count("***"))这一行是变量是 other_names这样改了后,语法没错误了
■网友
【python3.5下运行笨办法学python中习题41报错,麻烦哪位大神帮忙指点,错在哪了】 笨办法学python这书是讲python2.7的。你装虚拟机,在虚拟机的Windows 7中安装python2.7,再试试你的代码。


    推荐阅读