ProgrammingVery hardCAT · MBA placement

What is printed?

What is printed?
import unicodedata
print(unicodedata.normalize('NFC', 'e\u0301') == 'é', len(unicodedata.normalize('NFD', 'é')), 'é'.isidentifier(), 'Dž'.isidentifier())
  1. A. True 1 True False
  2. B. False 2 True True
  3. C. True 2 False True
  4. D. True 2 True True

Correct answer: D. True 2 True True

NFC composes e followed by a combining accent into the single code point é, and NFD splits it back into two. Both letters are valid identifier characters, and the title-case digraph Dž is a letter.

More Python Programming questions

Exams that ask this topic