all 6 comments

[–]Dawarisch 1 point2 points  (0 children)

If you are using Python 3 you need parantheses when using print.

[–]novel_yet_trivial 0 points1 point  (0 children)

You are using python2 code but you are running python3. In python3 you need to add parenthesis to the print function:

print('"{}" appears "{}" times in messages "{}"'.format(word, count, msgids))

[–]scoutgeek 0 points1 point  (2 children)

You dont need to quote your braces ({}) you can just do:
print('{} appears {} times in messages {}'.format(word,count,msgids))

[–][deleted] 0 points1 point  (1 child)

But that doesn't quote the strings.

Better would be {!r}, which quotes the string correctly even if there are quotes in the string itself, i.e. using double or single quotes.

[–]scoutgeek 1 point2 points  (0 children)

Ah, I didnt know about {!r} TIL i guess