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.
Related Questions on Python Built In Functions
Which built-in function is used to find the smallest item in an iterable?
A. min()
B. smallest()
C. minimum()
D. small()
What does the built-in function round() do in Python?
A. Rounds a floating-point number to the nearest integer
B. Returns the square of a number
C. Returns the absolute value of a number
D. Converts a number to a string
What does the built-in function max() do in Python?
A. Returns the largest item in an iterable
B. Converts a number to a string
C. Returns the square of a number
D. Returns the absolute value of a number
Which built-in function is used to check if all elements in an iterable are true?
A. all()
B. every()
C. true()
D. check()

Join The Discussion