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
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
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 tjre...@udel.edu wrote:
The turns an O(n) problem into a slow O(n*n) solution. Much
On 12 December 2012 07:52, Ross Ridge rri...@csclub.uwaterloo.ca 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
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 nowhere-spamcop,
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
In d6779e35-32b8-417a-abf9-72454573b...@googlegroups.com qbai...@ihets.org
writes:
crypto.py
Implements a simple substitution cypher
alpha = ABCDEFGHIJKLMNOPQRSTUVWXYZ
key = XPMGTDHLYONZBWEARKJUFSCIQV
def main():
keepGoing = True
while keepGoing:
response = menu()
2012/12/10 qbai...@ihets.org:
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
On Tue, Dec 11, 2012 at 9:38 AM, 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