ProgrammingModerateTCS NQT · Infosys

What is printed?

What is printed?
print(''.join(map(chr, [72, 105])), ord('A') > 127, len('ab'.encode('utf-8')))
  1. A. Hi True 2
  2. B. Hi False 4
  3. C. Hi False 2
  4. D. Ho False 2

Correct answer: C. Hi False 2

chr(72) and chr(105) give H and i. 'A' has code point 65, which is below 127, and two ASCII letters take two bytes in UTF-8.

More Python Programming questions

Exams that ask this topic