Re: [Tutor] Tutor Digest, Vol 146, Issue 9

2016-04-09 Thread khalil zakaria Zemmoura
Hi, there is one place i think you have to have a look at it and it's the python official site. One thing i love about python is the so well written documentation, i remember when i was learning ruby and had to go to the official doc! it was hard to understand for the beginner how i was. so, here

Re: [Tutor] Understanding error in recursive function

2016-04-09 Thread Oliver Bestwalter
Hi Tom, You can see what happens for yourself in the Pythontutor: http://goo.gl/YVkh03 - step through the code by clicking on "Forward" and see what happens. You are calling the howMany function from inside the function itself, which is called recursion. This can be practical, but in your case

Re: [Tutor] Understanding error in recursive function

2016-04-09 Thread khalil zakaria Zemmoura
Hi, I think your function runs forever because the only thing it done is calling it self when entering the for loop when you call your function in the for loop it jump to the definition (def howMany(aDict)) then initialise count and bond the value 0 to it then enter a for loop then call the

Re: [Tutor] Understanding error in recursive function

2016-04-09 Thread Mark Lawrence via Tutor
On 08/04/2016 21:48, Tom Maher wrote: Hi, As a test I am trying to write a function that returns the sum of values attached to one key in a dictionary. I am wondering why the code that I wrote is returning: "maximum recursion depth exceeded" Here is the code: animals = { 'a': ['aardvark'],