On 23/06/2011 03:19, bill lawhorn wrote:
I have a program: decrypt2.py which contains this function:


def scramble2Decrypt(cipherText):
     halfLength = len(cipherText) // 2
     oddChars = cipherText[:halfLength]
     evenChars = cipherText[halfLength:]
     plainText = ""

     for i in range(halfLength):
         plainText = plainText + evenChars[i]
         plainText = plainText + oddChars[i]

[snip]
FYI, this can be shortened to:

    plainText = cipherText[0 : : 2] + cipherText[1 : : 2]
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to