ProgrammingModerateTCS NQT · Infosys

What is printed?

What is printed?
print(bytes([104, 105]).decode(), bytes(b'ab').hex(), bytes([10, 255]).hex())
  1. A. hi 6162 0aff
  2. B. hi 6162 10ff
  3. C. hi 9899 0aff
  4. D. ab 6162 0aff

Correct answer: A. hi 6162 0aff

Decoding bytes 104 and 105 as ASCII gives 'hi'. hex() shows each byte as two hex digits, so 10 is 0a and 255 is ff.

More Python Programming questions

Exams that ask this topic