On Tue, 11 Dec 2012 16:39:27 +, duncan smith wrote:
[snip]
> >>> alpha = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
> >>> key = "XPMGTDHLYONZBWEARKJUFSCIQV"
> >>> mapping = {}
> >>> for i, ch in enumerate(alpha):
> mapping[ch] = key[i]
mapping = dict(zip(alpha, key))
--
To email me, substitute nowhe
On 12 December 2012 07:52, Ross Ridge wrote:
> John Gordon wrote:
> > def encode(plain):
> > '''Return a substituted version of the plain text.'''
> > encoded = ''
> > for ch in plain:
> >encoded += key[alpha.index(ch)]
> > return encoded
>
> Terry Reedy wrote:
> >The tu
John Gordon wrote:
> def encode(plain):
> '''Return a substituted version of the plain text.'''
> encoded = ''
> for ch in plain:
>encoded += key[alpha.index(ch)]
> return encoded
Terry Reedy wrote:
>The turns an O(n) problem into a slow O(n*n) solution. Much better to
>
On 12/10/2012 5:59 PM, John Gordon wrote:
def encode(plain):
'''Return a substituted version of the plain text.'''
encoded = ''
for ch in plain:
encoded += key[alpha.index(ch)]
return encoded
The turns an O(n) problem into a slow O(n*n) solution. Much better to
build a
On 10/12/12 22:38, qbai...@ihets.org wrote:
I need help with a program i am doing. it is a cryptography program. i am given
a regular alphabet and a key. i need to use the user input and use the regular
alphabet and use the corresponding letter in the key and that becomes the new
letter. i hav
On Tue, Dec 11, 2012 at 9:38 AM, wrote:
> I need help with a program i am doing. it is a cryptography program. i am
> given a regular alphabet and a key. i need to use the user input and use the
> regular alphabet and use the corresponding letter in the key and that becomes
> the new letter. i
2012/12/10 :
> I need help with a program i am doing. it is a cryptography program. i am
> given a regular alphabet and a key. i need to use the user input and use the
> regular alphabet and use the corresponding letter in the key and that becomes
> the new letter. i have the basic code but nee
In qbai...@ihets.org
writes:
> """ crypto.py
> Implements a simple substitution cypher
> """
> alpha = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
> key = "XPMGTDHLYONZBWEARKJUFSCIQV"
> def main():
> keepGoing = True
> while keepGoing:
> response = menu()
> if response == "1":
> plain
I need help with a program i am doing. it is a cryptography program. i am given
a regular alphabet and a key. i need to use the user input and use the regular
alphabet and use the corresponding letter in the key and that becomes the new
letter. i have the basic code but need help with how to mai