I\'ve very recently migrated to Py 3.5. This code was working properly in Python 2.7:
with open(fname, \'rb\') as f: lines = [x.strip() for x in f.readli
Use encode() function along with hardcoded String value given in a single quote.
Ex:
file.write(answers[i] + '\n'.encode())
OR
line.split(' +++$+++ '.encode())