ProgrammingVery hardTCS NQT · Accenture

What is printed?

What is printed?
print(hex(255).upper(), int('FF', 16) == 0xff, '%X' % 255 == hex(255)[2:].upper(), oct(64))
  1. A. 0XFF False True 0o100
  2. B. 0xFE True True 0o100
  3. C. 0XFF True False 0o64
  4. D. 0XFF True True 0o100

Correct answer: D. 0XFF True True 0o100

hex(255).upper() is 0XFF, and int('FF', 16) equals 0xff. %X and hex digits agree, and oct(64) is 0o100 because 64 is 8 squared.

More Python Programming questions

Exams that ask this topic