encryption - Using a caesarian cipher on a string of text in python? -
I am trying to extract all the complexity of the dragon gradually. Actually, I'm looking for some kind of dragon, take a string of letters and push everyone over the 'X' characters.
For example, abcdefg input will be cdefghi (if x is 2).
I will do this (for conceptual simplicity):
< Code> def encode (s): l = [ord (i) for i) return '' .join (i for i [chr (i + 2) i] i
point it Is that you convert this letter to ASCII, add 2 to that code, convert it back and "cast" (create a new string object) in the string, anybody based on this "case" (upper vs. bottom) Does not convert.
Potential Optimization / Research area:
- Use string-eio modules for large stars
- Apply it to Unicode (not sure how)
Comments
Post a Comment