def encipher(self,string,keep_punct=False):
        """Encipher string using Atbash cipher.

        Example::

            ciphertext = Atbash().encipher(plaintext)     

        :param string: The string to encipher.
        :param keep_punct: if true, punctuation and spacing are retained. If false, it is all removed. Default is False. 
        :returns: The enciphered string.
        """       
        if not keep_punct: string = self.remove_punctuation(string)
        ret = ''
        for c in string.upper():
            if c.isalpha(): ret += self.key[self.a2i(c)]
            else: ret += c
        return ret
def encipher ( self , string , keep_punct = False ) : if not keep_punct : string = self . remove_punctuation ( string ) ret = '' for c in string . upper ( ) : if c . isalpha ( ) : ret += self . key [ self . a2i ( c ) ] else : ret += c return ret
Encipher string using Atbash cipher.

        Example::

            ciphertext = Atbash().encipher(plaintext)     

        :param string: The string to encipher.
        :param keep_punct: if true, punctuation and spacing are retained. If false, it is all removed. Default is False. 
        :returns: The enciphered string.