Re: [Tutor] Python challenge and decryption

2011-12-23 Thread col speed
> That's exactly the point. > Very few people know about maketrans before they take the Python Challenge. > > But that's the whole point of the challenge, as you go through it you will > discover new and powerful tools in the Python library that save you from > having to invent your own. (Look out

Re: [Tutor] Python challenge and decryption

2011-12-23 Thread Alan Gauld
On 23/12/11 16:58, Joaquim Santos wrote: Thanks for all the tips so far. The maketrans like suggested probably would be faster but I didn't knew about it That's exactly the point. Very few people know about maketrans before they take the Python Challenge. But that's the whole point of the cha

Re: [Tutor] Python challenge and decryption

2011-12-23 Thread Prasad, Ramit
Posting as HTML caused your indentation to be all wrong. Try to post as plain text to remove those errors. Thankfully your program is not very complicated. import string def decrypt(cypheredText, shiftedCypherNumber): ''' This function will take two arguments. The first is the cyphered text,

Re: [Tutor] Python challenge and decryption

2011-12-23 Thread Joaquim Santos
Hi again list! I've been trying to implement the feedback I got. So far, I removed the print statements from the function, limited the range (just for the z at the moment) and tried to get all printing in one or two lines... but without success... I don't know if I'm doing the join as it should...

Re: [Tutor] Python challenge and decryption

2011-12-21 Thread Dave Angel
On 12/21/2011 06:39 AM, Joaquim Santos wrote: Hi List! Thanks for all the input you guys gave me! I'm trying to implement your ideas on the function and I've been getting some parts right (the correct translation, still vertical and without spaces) or the wrong translation but with spaces... My

Re: [Tutor] Python challenge and decryption

2011-12-21 Thread Joaquim Santos
Hi List! Thanks for all the input you guys gave me! I'm trying to implement your ideas on the function and I've been getting some parts right (the correct translation, still vertical and without spaces) or the wrong translation but with spaces... My problem is my range check. I'm also getting a f

Re: [Tutor] Python challenge and decryption

2011-12-19 Thread col speed
On 20 December 2011 03:00, Joaquim Santos wrote: > Hi list! > > This is my first post here but I've been following the list for some time > now! I know that recently there was a message about decryption and all. I > think that was what made me go back into the Python challenge and try to > solve s

Re: [Tutor] Python challenge and decryption

2011-12-19 Thread Steven D'Aprano
Joaquim Santos wrote: - How can I make this "Human readable"? ... Print the letters in just one (or more) lines and maybe replace the " for spaces (This one I suppose it could/should be done with whitespaces() or just making a loop to check and change those for ' '.) Firstly, you should not

Re: [Tutor] Python challenge and decryption

2011-12-19 Thread Prasad, Ramit
Hi list!  My Python version is 2.7.1 and my OS is Linux Mint 11. My code is this one: def decrypt(cypheredText, shiftedCypherNumber): ''' This function will take two arguments. The first is the cyphered text, the second is the number of characters we need to shift the text so we can decrypt it.

[Tutor] Python challenge and decryption

2011-12-19 Thread Joaquim Santos
Hi list! This is my first post here but I've been following the list for some time now! I know that recently there was a message about decryption and all. I think that was what made me go back into the Python challenge and try to solve some of them... For the second one, I first laid on paper my