ProgrammingVery hardTCS CodeVita · Infosys HackWithInfy

What is printed?

What is printed?
print(ord('A') ^ 32, chr(ord('a') - 32))
  1. A. 65 A
  2. B. 98 a
  3. C. 66 b
  4. D. 97 A

Correct answer: D. 97 A

65 XOR 32 flips the case bit, giving 97, which is 'a'. Subtracting 32 from 97 gives 65, which is 'A'.

More Python Programming questions

Exams that ask this topic