Talk:Non-Programmer's Tutorial for Python 2.0/Defining Functions

From Wikibooks, the open-content textbooks collection

Jump to: navigation, search

Hello, there is an error on the exercise, where at the one write "q" the program says "Unrecognized option." so it mus says nothing or good bye, w/e. it should says at the code

   elif choice == q:
       print "",

and it will go out quietly,

thanks for this nice tutorial!!

I think the print "", might confuse people, so I changed it to a plain print statement. It's a bit of a pity having to handle the q choice case in two places here (while and elif) because we don't know break yet. Apart from that the elif colon was missing. --Siebengang 09:27, 15 October 2007 (UTC)

[edit] Different or more wording needed

"Inside of the function a_var is 15 since the function is called with a_func(b_var). Since at that point in time b_var is 15, the call to the function is a_func(15) This ends up setting a_var to 15 when it is inside of a_func."

I think this is important enough to be explained in greater detail. --Charlesrkiss 3 April 2008
I tried to expand upon it somewhat to try and reinforce the point. --Tehdrago (talk) 15:15, 16 November 2008 (UTC)

"When eliminating repeated code, you often have variables in the repeated code. In Python, these are dealt with in a special way."

I find the wording here a bit confusing, I'm still not sure what was trying to be stated, even after having re-read it several times. --Tehdrago (talk) 15:15, 16 November 2008 (UTC)