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

Popular posts from this blog

c# - Binding a comma separated list to a List<int> in asp.net web api -

Delphi 7 and decode UTF-8 base64 -

html - Is there any way to exclude a single element from the style? (Bootstrap) -