ProgrammingHardTCS NQT · Accenture

What is printed?

What is printed?
print(ord('A') + 1, chr(ord('a') - 32))
  1. A. 67 a
  2. B. 66 A
  3. C. 65 Z
  4. D. 67 B

Correct answer: B. 66 A

ord('A') is 65, so adding 1 gives 66. Subtracting 32 from ord('a') gives the uppercase letter A.

More Python Programming questions

Exams that ask this topic