Mar-09-2019, 11:42 PM
(This post was last modified: Mar-09-2019, 11:48 PM by FWendeburg.)
(Mar-08-2019, 09:21 PM)ichabod801 Wrote: You are going to have to be more specific about how you are testing it. It works fine when I run it. That doesn't look like an error, it looks like the repr for an instance of w_encryption. My guess is your test is returning the encryption object when it should be returning the encrypted text.
Edit: for example:
Output:>>> test = w_encryption('Avalokiteshvara') >>> test._encrypt_() '14061962245146643241220108292105138248193963515807825' >>> test <__main__.w_encryption instance at 0x0000000003988548>
Thanks for your response!
I was doing:
test = w_encryption('hello') test._encrypt_() print(test)Haha that's why I got "<__main__.w_encryption instance at 0x0000000003988548>" in response.
(Mar-09-2019, 01:22 AM)woooee Wrote: You can save yourself a whole lot of lines of code by using a dictionaryencr_dict={'a':(1, 50) 'b':(300, 400)} if echar in encr_dict: echar = randint(encr_dict(echar)) self.encrypted.append(echar) ## etc ## replaces if character == 'a': echar = randint(1, 50) self.encrypted.append(echar) elif character == 'b': echar = randint(300, 400) self.encrypted.append(echar)Finally, how are you going to decode it since you don't know which random number was used to encode it?
Thanks for your response!
But I already wrote the code for 80+ characters. Haha