Computer Science, asked by shaunxylo, 8 months ago

Write a program to accept a name. Then display the ASCII value of each character present
in that name​

Answers

Answered by Anonymous
10

AnswEr :

The built in function input() is used for saving a name.

The code would be :

name = 'what is your name?'

>>> input(name)

what is your name? Karthik

>>> 'Karthik'

Since,the name has been accepted. Now,let's find the ASCII values of each characters in the above string.

  • ASCII values of a character is found by using ord().
  • For example, ord(Alphabet)

Now,

\begin{array}{|c|c|} \cline{1-2} \sf Character & \sf ASCII \ No. \\ \cline{1-2} \sf K & 75 \\ \cline{1-2} \sf A & 65 \\ \cline{1-2} \sf R & 82 \\ \cline{1-2} \sf T & 84 \\ \cline{1-2} \sf H & 72 \\ \cline{1-2} \sf I & 73 \\ \cline{1-2} \end{array}

(Refer to the attachments)

Attachments:
Similar questions