Re: [Tutor] Recursion always returns None

2012-08-28 Thread Joel Goldstick
On Tue, Aug 28, 2012 at 5:14 PM, Alan Gauld wrote: > On 28/08/12 17:34, Steve Willoughby wrote: >>> For some reason some beginners seem to find recursion a natural pattern. >> >> >> There is a certain "hey, you can do that? That's cool!" factor when you >> first discover recursion. > > >

Re: [Tutor] Recursion always returns None

2012-08-28 Thread Alan Gauld
On 28/08/12 17:34, Steve Willoughby wrote: For some reason some beginners seem to find recursion a natural pattern. There is a certain "hey, you can do that? That's cool!" factor when you first discover recursion. My point was that it seems to be a natural idea for many beginners, they dis

Re: [Tutor] Recursion always returns None

2012-08-28 Thread Steve Willoughby
On 28-Aug-12 09:13, Alan Gauld wrote: On 28/08/12 16:51, Dharmit Shah wrote: @Dave Angel : Thank you for the loop idea. It didn't strike me at all. For some reason some beginners seem to find recursion a natural pattern. There is a certain "hey, you can do that? That's cool!" factor when yo

Re: [Tutor] Recursion always returns None

2012-08-28 Thread Steve Willoughby
On 28-Aug-12 09:03, Mark Lawrence wrote: On 28/08/2012 16:51, Dharmit Shah wrote: @ Steve : Thank you. As suggested by Dave Angel, I am going to try the loop. And even before implementing it, I can feel that it's going to be more efficient than recursion. May I ask why you appear to be conce

Re: [Tutor] Recursion always returns None

2012-08-28 Thread Alan Gauld
On 28/08/12 16:51, Dharmit Shah wrote: @Dave Angel : Thank you for the loop idea. It didn't strike me at all. For some reason some beginners seem to find recursion a natural pattern. Many others, including quite experienced programmers find it a mind bending concept. But as a general rule, wh

Re: [Tutor] Recursion always returns None

2012-08-28 Thread Mark Lawrence
On 28/08/2012 16:51, Dharmit Shah wrote: @ Steve : Thank you. As suggested by Dave Angel, I am going to try the loop. And even before implementing it, I can feel that it's going to be more efficient than recursion. May I ask why you appear to be concerned with efficiency for a hangman game?

Re: [Tutor] Recursion always returns None

2012-08-28 Thread Dharmit Shah
Hello, @Hugo Arts : Thank you! That was awesome to read. Thanks for the len() suggestion. @ Steve : Thank you. As suggested by Dave Angel, I am going to try the loop. And even before implementing it, I can feel that it's going to be more efficient than recursion. @Dave Angel : Thank you for the

Re: [Tutor] Recursion always returns None

2012-08-28 Thread Dave Angel
On 08/28/2012 07:23 AM, Dharmit Shah wrote: > Hello, > > I am trying to do the following : > > 1) Ask user for the length of the word that he'd like to guess (for > hangman game). > 2) Pick a random word from /usr/share/dict/words (which I understand > is not the best choice for hangman). > 3) Call

Re: [Tutor] Recursion always returns None

2012-08-28 Thread Steve Willoughby
On 28-Aug-12 04:23, Dharmit Shah wrote: Hello, I am trying to do the following : 1) Ask user for the length of the word that he'd like to guess (for hangman game). 2) Pick a random word from /usr/share/dict/words (which I understand is not the best choice for hangman). 3) Call a function that w

Re: [Tutor] Recursion always returns None

2012-08-28 Thread Hugo Arts
On Tue, Aug 28, 2012 at 1:23 PM, Dharmit Shah wrote: > Hello, > > I am trying to do the following : > > 1) Ask user for the length of the word that he'd like to guess (for > hangman game). > 2) Pick a random word from /usr/share/dict/words (which I understand > is not the best choice for hangman)

[Tutor] Recursion always returns None

2012-08-28 Thread Dharmit Shah
Hello, I am trying to do the following : 1) Ask user for the length of the word that he'd like to guess (for hangman game). 2) Pick a random word from /usr/share/dict/words (which I understand is not the best choice for hangman). 3) Call a function that would pick a random word to proceed further