2

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.

wjandrea
  • 16,334
  • 5
  • 30
  • 53

0 Answers0