ASCII conversion in Python -
i making encryption program easy make if use ascii numbers represent character.(using deprecated string.translate) there way pass character through ascii number , append string?
i think you're looking chr
:
return string of 1 character ascii code integer i. example, chr(97) returns string 'a'. inverse of ord(). argument must in range [0..255], inclusive; valueerror raised if outside range. see unichr().
and ord
:
given string of length one, return integer representing unicode code point of character when argument unicode object, or value of byte when argument 8-bit string.
example:
print("somestring" + chr(65)) # prints "somestringa"
Comments
Post a Comment