225k views
2 votes
Which of the following functions and expressions will convert the ASCII character "Z" to its numeric equivalent ASCII code?

a.ord('Z')
b.ord(chr('Z'))
c.chr(ord('Z'))
d.chr('Z')

User Tdashroy
by
8.2k points

2 Answers

6 votes

Answer:

The answer is A

Have a wonderful day!

Step-by-step explanation:

User MBHA Phoenix
by
7.6k points
5 votes

Answer:

The answer is "Option a"

Step-by-step explanation:

In Python, ord() function takes the length string 1 as a parameter and returns the representation of the passed argument for the Unicode point. For example, ord('Z') return value 90 that is a Unicode code value of character 'Z'. and other function is not correct that can be described as follows:

  • In option b, Inside the ord function chr function is used that accepts only numeric value that' why it is not correct.
  • In option c, Inside the chr function ord function is used that cover value in lower case that's why it is not correct.
  • In option d, The chr function accepts only numeric value that's why this option is not correct.

User Imperalix
by
8.6k points
Welcome to QAmmunity.org, where you can ask questions and receive answers from other members of our community.