Re: [Tutor] Suggestions for more efficient and optimized coding technique,

2009-01-08 Thread spir
Le Thu, 8 Jan 2009 11:34:49 -0500, "Michael Langford" a écrit : > Here is your algorithm made more pythonic. Notice the use of default > parameters, doc strings, not abbreviated variable names, unix C style > capitolization (very subjective, but often the one found in python > libs), the avoidan

Re: [Tutor] Suggestions for more efficient and optimized coding technique,

2009-01-08 Thread Robert Berman
Thank you again. I now have enough to keep me happily busy for days. Robert Michael Langford wrote: I understand that each response is unique Robert and no caching is required to solve the problem at hand. However in a real program, the chance you're brute forcing just one password is small (us

Re: [Tutor] Suggestions for more efficient and optimized coding technique,

2009-01-08 Thread Michael Langford
I understand that each response is unique Robert and no caching is required to solve the problem at hand. However in a real program, the chance you're brute forcing just one password is small (usually you would brute force many); additionally, the question posted specifically asked that the trials

Re: [Tutor] Suggestions for more efficient and optimized coding technique,

2009-01-08 Thread Robert Berman
Richard Lovely wrote: 2009/1/8 Kent Johnson : This is a strange requirement. If you want to try all combinations of lowercase letters, the simplest way to do that is with nested loops. The loops will generate all combinations without repeating, so there is no need to save the use

Re: [Tutor] Suggestions for more efficient and optimized coding technique,

2009-01-08 Thread Robert Berman
Kent Johnson wrote: On Thu, Jan 8, 2009 at 10:49 AM, Robert Berman wrote: Hi, One of the challenges on the challenge you web page appropriately titled 'Brute force' reads as follows: "The password you have to guess is 'loner' . Try all combinations of lowercase letters until y

Re: [Tutor] Suggestions for more efficient and optimized coding technique,

2009-01-08 Thread Robert Berman
Michael, Thank you for your code and your commentary. The code tells me this is really an ongoing learning process; almost as convoluted as linguistics and certainly every bit as interesting. Your concept of brute force in this example is intriguing. It is as if I have five cogs spinning, 'a'

Re: [Tutor] Suggestions for more efficient and optimized coding technique,

2009-01-08 Thread Richard Lovely
2009/1/8 Kent Johnson : > > This is a strange requirement. If you want to try all combinations of > lowercase letters, the simplest way to do that is with nested loops. > The loops will generate all combinations without repeating, so there > is no need to save the used combinations. > or itertool

Re: [Tutor] Suggestions for more efficient and optimized coding technique,

2009-01-08 Thread Kent Johnson
On Thu, Jan 8, 2009 at 10:49 AM, Robert Berman wrote: > Hi, > > One of the challenges on the challenge you web page appropriately titled > 'Brute force' reads as follows: > > "The password you have to guess is 'loner' . Try all combinations of > lowercase letters until you guess it. Try not to lo

Re: [Tutor] Suggestions for more efficient and optimized coding technique,

2009-01-08 Thread Michael Langford
Here is your algorithm made more pythonic. Notice the use of default parameters, doc strings, not abbreviated variable names, unix C style capitolization (very subjective, but often the one found in python libs), the avoidance of control variables when possible, the use of ascii_lowercase instead

[Tutor] Suggestions for more efficient and optimized coding technique,

2009-01-08 Thread Robert Berman
Hi, One of the challenges on the challenge you web page appropriately titled 'Brute force' reads as follows: "The password you have to guess is 'loner' . Try all combinations of lowercase letters until you guess it. Try not to loop much for example, save all used combinations in an array so