I was trying to replicate this example https://mail.python.org/pipermail/python-list/2012-May/624363.html
I'm brushing up on my python coding skills and was studying the various string methods, and I found the methods isdigit, isdecimal, and isnumeric interesting. The python docs don't provide many examples so I am making my own that I can review whenever I wish. The very first example shown at the above link fails in my python 3.5 console. The output looks like this:
>>> c = '\u2155'
>>> print(c)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Program Files (x86)\Python35-32\lib\encodings\cp437.py", line 19, in
encode
return codecs.charmap_encode(input,self.errors,encoding_map)[0]
UnicodeEncodeError: 'charmap' codec can't encode character '\u2155' in position
0: character maps to <undefined>
The following test with other fractions worked okay for me.
>>> value = '\u00BC'
>>> print(value)
¼
>>> value.isdecimal()
False
>>> value.isdigit()
False
What am I missing?