What will be the output of the following Python function?
ord(65)
ord(‘A’)
ord(65)
ord(‘A’)A. A
65
B. Error
65
C. A
Error
D. Error
Error
Answer: Option B
Solution (By Examveda Team)
Option B: Error65
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.

Join The Discussion