Re: [Tutor] Function question

2017-03-25 Thread Sri Kavi
On Sat, Mar 25, 2017 at 3:31 PM, Peter O'Doherty wrote: > > def myFunc(num): > for i in range(num): > print(i) > > print(myFunc(4)) > 0 > 1 > 2 > 3 > None #why None here? > > Because there are two print() functions, one inside the function and another outside. When a function does

Re: [Tutor] Retrieving DropDown List Values

2017-03-25 Thread Alan Gauld via Tutor
On 25/03/17 04:29, Braxton Jackson wrote: > Is there a simple command for retrieving the chosen value a user inputs > from a dropdown list? I am new to Python and cant seem to find a good > tutorials link on retreiving drop down values. That all depends on which GUI toolkit you are using. The

[Tutor] Retrieving DropDown List Values

2017-03-25 Thread Braxton Jackson
Is there a simple command for retrieving the chosen value a user inputs from a dropdown list? I am new to Python and cant seem to find a good tutorials link on retreiving drop down values. ___ Tutor maillist - Tutor@python.org To unsubscribe or change

Re: [Tutor] Function question

2017-03-25 Thread Alan Gauld via Tutor
On 25/03/17 10:01, Peter O'Doherty wrote: > def myFunc(num): > for i in range(num): > print(i) > > print(myFunc(4)) > 0 > 1 > 2 > 3 > None #why None here? Because your function does not have an explicit return value so Python returns its default value - None. So the print() inside

[Tutor] Function question

2017-03-25 Thread Peter O'Doherty
Hi, Apologies for the very basic question but could anyone explain the behaviour of these two functions (in Python3.5)? def myFunc(num): for i in range(num): print(i) print(myFunc(4)) 0 1 2 3 None #why None here? def myFunc(num): for i in range(num): return i