ProgrammingVery hardTCS CodeVita · Infosys HackWithInfy
What is printed?
What is printed?
print(ord('A') ^ 32, chr(ord('a') - 32))- A. 65 A
- B. 98 a
- C. 66 b
- 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
- What is printed? python t = ([],) t[0].append(1) print(t, t[0] is t[0])
- What is printed? python print(list(dict.fromkeys('mississippi')))
- What is printed? python print(any([]) or all([]) and 'x')
- What is printed? python s = 'hello' print(s[1:-1][::-1], s[-1:0:-2])
- What is printed? python d = {} d.setdefault('k', []).append(1) d.setdefault('k', []).append(2) print(d)
- What is printed? python print(1 / 3 + 1 / 3 + 1 / 3 == 1.0, 0.1 + 0.7)