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

swift - Button on Table View Cell connected to local function -

dns - Dokku server hosts two sites with TLD's, both domains are landing on only one app -

c# - ajax - How to receive data both html and json from server? -