The 'in' Operator Error


Traceback (most recent call last):
File "python", line 10, in
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc2 in position 0: ordinal not in range(128)

What happened?

my_dict = {
    'Turtles': 'Shell',
    'Bacon': 'Yum',
    'idontknowwhattoputinhereso': '¯\_(ツ)_/¯'
print my_dict.keys()
print my_dict.values()

for key in my_dict:
    print key, my_dict[key]


Try without the silly code!

The part I am referring to is this: '¯_(ツ)_/¯'


Oh, thanks. that really helped (I knew i shouldn't have done that)


There are work-arounds but the best one, if available, is to simply upgrade the involved tools, including python


Yeah, I got the idea when the error said about 'ascii'.

To my knowledge, ascii means the characters that you use on your computer. And I saw that you used some weird ones - so now you know.


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.