ProgrammingHardTCS NQT · Accenture
What is printed?
What is printed?
print(ord('A') + 1, chr(ord('a') - 32))- A. 67 a
- B. 66 A
- C. 65 Z
- 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
- What is printed? python print(divmod(7, -2), 7 % -2)
- What is printed? python print(sum([[1], [2, 3]], []))
- What is printed? python x = (1, [2]) x[1].append(3) print(x)
- What is printed? python print(max([1, 5, 3], key=lambda v: -v))
- What is printed? python print(list(map(int, '1 2 3'.split()))[::-1])
- What is printed? python print(f'{7:03d}|{-7:d}|')