Syntaxerror: unexpected EOF while parsing solution and ideas

Online learning code, error reporting

SyntaxError: unexpected EOF while parsing

If you encounter this problem, first check whether the parentheses are written less

View source code

res = sorted(res.iteritems(), key=lambda x : x[1])

The code is the version of python2. X. res.iteritems () has been dropped under python3. X, so it is modified to

res = sorted(res.items(), key=lambda x : x[1])

Read More: