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 2021 CCC Practice Test Hindi Python Programming Tutorials Best Computer Training Institute in Prayagraj (Allahabad) Best Java Training Institute in Prayagraj (Allahabad) Best Python Training Institute in Prayagraj (Allahabad) O Level Online Test in Hindi Bank SSC Railway TET UPTET Question Bank career counselling in allahabad Sarkari Naukari Notification Best Website and Software Company in Allahabad Sarkari Exam Quiz