Python program to print ASCII Value of Total Characters in a String

myStr = input("Enter the String: ")
for i in range(len(myStr)):
    print("The ASCII Value of Character %c = %d" %(myStr[i], ord(myStr[i])))

OUTPUT:

Enter the String: CHASE
The ASCII Value of Character C = 67
The ASCII Value of Character H = 72
The ASCII Value of Character A = 65
The ASCII Value of Character S = 83
The ASCII Value of Character E = 69

Leave a Comment