122k views
3 votes
Which print statement would display the letter 'A'? (Note that the code point for the letter 'A' is 65.)

- print(code_point (65))
- print(ord(65))
- print(chr(65))
- print (unicode (65))

User Teacher
by
8.3k points

1 Answer

7 votes

Final Answer:

The print statement that would display the letter 'A' is: print (chr (65)). Option C is answer.

Step-by-step explanation:

In Python, the chr () function is used to convert an ASCII code (code point) to its corresponding character. The code point for the letter 'A' is 65. Therefore, chr (65) will return the character 'A'. The other options are incorrect because:

code_point (65) is not a valid syntax in Python; it should be chr (65) for character conversion.

ord (65) returns the numeric value of the ASCII code, so ord (65) would give 65, not 'A'.

unicode (65) is also not a valid function; it should be chr (65).

The correct statement is print (chr (65)). Option C is answer.

User Ayoka
by
7.7k points