ProgrammingVery hardCAT · MBA placement

What is printed?

What is printed?
print('ß'.upper(), 'Dž'.lower(), len('ß'.upper()), 'İ'.lower() == 'i')
  1. A. SS dž 1 True
  2. B. ß dž 1 False
  3. C. SS dž 2 False
  4. D. SS dž 2 True

Correct answer: C. SS dž 2 False

Full Unicode case mapping turns German sharp s into the two letters SS, so its upper form has length 2. The Latin letter dz with caron lowercases to dž, and the dotted capital I lowercases to i followed by a combining dot, so it is not equal to plain 'i'.

More Python Programming questions

Exams that ask this topic