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
▶ RUN

Output/ Explanation:

Enter Message to encode : infomax

ASCII code for message : 

105 110 102 111 109 97 120 

>>> 

Latest Current Affairs 2025 Online Exam Quiz for One day Exam Online Typing Test CCC Online Test Python Programming Tutorials Best Computer Training Institute in Prayagraj (Allahabad) Online MBA 2 years Online MCA Online BCA Best Website and Software Company in Allahabad