How to Find ASCII Value of Character using Python?

PythonProgramming

The ord function in python gives the ordinal value of a character(ASCII). You can use this function to find the ascii codes as follows

Example

s = "Hello"
for c in s:
   print(ord(c))

Output

This will give the output

72
101
108
108
111
raja
Published on 20-Apr-2018 07:55:02
Advertisements