If I try to use a magic comment like #coding=utf-8
on top of a file, here's what happens:
Traceback (most recent call last):
File <string>, line 0
SyntaxError: encoding declaration in Unicode string
I really haven't done anything wrong. Here is the code:
#coding=utf-8
string = raw_input()
chars = {}
for i in string:
if i in chars:
chars[i] += 1
else:
chars[i] = 0
print chars
I use repl.it.