Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

whats the easiest way of converting a character into its ascii equivalent in python? [duplicate]

Tags:

python

Possible Duplicate:
ASCII value of a character in python

The method I have applied is mapping the characters in an array . Is there a library for it ?

like image 874
Hick Avatar asked Oct 19 '25 14:10

Hick


1 Answers

ord() — or are you asking for something entirely different?

Given a string of length one, return an integer representing the Unicode code point of the character when the argument is a unicode object, or the value of the byte when the argument is an 8-bit string. … This is the inverse of chr() for 8-bit strings and of unichr() for unicode objects.

like image 109
jensgram Avatar answered Oct 21 '25 02:10

jensgram



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!