Examveda

What will be the output of the following Python function?
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: 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.

This Question Belongs to Python Program >> Python Built In Functions

Join The Discussion

Related Questions on Python Built In Functions