Home / Engineering / Problem Solving and Python Programming / Question

M

Mr. Dubey • 51.47K Points
Coach

Q.) What will be displayed by print(ord(‘b’) – ord(‘a’))?

(A) 0
(B) 1
(C) -1
(D) 2
Correct answer : Option (B) - 1

Explanation:
 ascii value of b is one more than a. hence the output of this code is 98-97, which is equal to 1.

Share

Discusssion

Login to discuss.