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 

>>> 

CCC Online Test Python Programming Tutorials Best Computer Training Institute in Prayagraj (Allahabad) Online Exam Quiz O Level NIELIT Study material and Quiz Bank SSC Railway TET UPTET Question Bank career counselling in allahabad Best Website and Software Company in Allahabad Website development Company in Allahabad