String not changing to uppercase

Viewed 107

I would like to know why am I not getting the desired output ? my code -

 = ['', '']
for i in :
  print(i.upper())
print()

OUTPUT -



['', '']

Desired OUTPUT -

FREE
CODECAMP
['', '']
1 Answers

Your words are written in the mathematical monospace font for which there are no upper-case letters:

hex(ord(mylist[0][0]))
#'0x1d68f'
hex(ord('f'))
#'0x66' - this is the "normal f"
mylist[0][0] == 'f'
# False

So, technically everything works: i.upper() converts i to the upper case, but since there are no upper-case letters, the result of the conversion is the same string.

Related