ProgrammingHardTCS CodeVita · Infosys HackWithInfy

What is printed?

What is printed?
print(chr(ord('a') + 27), ord('Z') - ord('A'), chr(0x1F600) == '\U0001F600', len('\U0001F600'))
  1. A. | 25 True 4
  2. B. | 25 False 1
  3. C. | 26 True 1
  4. D. | 25 True 1

Correct answer: D. | 25 True 1

ord('a') + 27 is 124, the code point of '|'. ord('Z') - ord('A') is 25. The escape \U0001F600 is one code point, so its length is 1 in Python 3.

More Python Programming questions

Exams that ask this topic