Python 3 weird len function behavior

Viewed 71

I have the following code

for i in range(500):
 if(len(chr(i).upper())==2):
  print(chr(i))

surprisingly this print some characters on the screen, while this code does not

for i in range(500):
 if(len(chr(i))==2):
  print(chr(i))

why is some character when pass through the method upper, yields length of two ? I heard it's related to buffer and unicode (?) I still don't know.

0 Answers
Related