Vidyalelo
Python · Q37

Python Built

Programming · Python · question 37

Q37

What will be the output of the following Python function? ord(65) ord(‘A’)

A.
A
65
B.
Error
65
Answer
C.
A
Error
D.
Error
Error

Answer: Option B

Solution

Answer: Option B
Solution:
Option B: Error
65


When the argument '65' is passed to the ord() function, it's treated as an integer and not a valid Unicode character. Therefore, the function will not raise an error. Instead, it will return the Unicode code point of the character corresponding to the integer 65, which is 'A'.

Hence, the correct answer is indeed
Option B: Error
65.