Programming Examples
Python program to print ASCII code for entered message
Write a Python program to print ASCII code for entered message
Solution
message=input("Enter Message to encode : ")
print("ASCII code for message : ")
for ch in message:
print(ord(ch),end=" ") # ord function return the ascii value of char
Output
Enter Message to encode : infomax
ASCII code for message :
105 110 102 111 109 97 120
>>>