1

I have to do a program where it will ask first name then last name. How to print the ASCII values of each letter that the user will input in the first name and last name?

a121
  • 798
  • 4
  • 9
  • 20

1 Answers1

0
first=input("enter first name")
last= input("enter last name")
for i in first:
     print("ascii value of",i, "is:",ord(i))
for j in last:
     print("ascii value of",j, "is:",ord(j))

The function required for this is ord()

a121
  • 798
  • 4
  • 9
  • 20