Re: function code snippet that has function calls I have never seen before. How does it work.

2015-10-04 Thread Steven D'Aprano
On Sun, 4 Oct 2015 04:40 am, Ronald Cosentino wrote: > def funA(x,y,z): > return (x+y) * z > def funB(x,y): > return(x-y) > print(funA(4,funB(2,3), funB(3,2))) > > the answer is 3. I don't know how it works. Break it up and consider it a little at a time, starting with the three values

Re: function code snippet that has function calls I have never seen before. How does it work.

2015-10-03 Thread Denis McMahon
On Sat, 03 Oct 2015 10:40:57 -0700, Ronald Cosentino wrote: > def funA(x,y,z): > return (x+y) * z > def funB(x,y): > return(x-y) > print(funA(4,funB(2,3), funB(3,2))) > > the answer is 3. I don't know how it works. def funA(x, y, z): return (x+y) * z def funB(x, y): return (x-y)

Re: function code snippet that has function calls I have never seen before. How does it work.

2015-10-03 Thread Ervin Hegedüs
hi, On Sat, Oct 03, 2015 at 10:40:57AM -0700, Ronald Cosentino wrote: > def funA(x,y,z): > return (x+y) * z > def funB(x,y): > return(x-y) > print(funA(4,funB(2,3), funB(3,2))) > > the answer is 3. I don't know how it works. it's simple: - there is a "composition of functions", generall

RE: function code snippet that has function calls I have never seen before. How does it work.

2015-10-03 Thread Joseph Lee
Hi Ronald, Answers inline. -Original Message- From: Python-list [mailto:python-list-bounces+joseph.lee22590=gmail@python.org] On Behalf Of Ronald Cosentino Sent: Saturday, October 3, 2015 10:41 AM To: python-list@python.org Subject: function code snippet that has function calls I have

Re: function code snippet that has function calls I have never seen before. How does it work.

2015-10-03 Thread Joel Goldstick
On Sat, Oct 3, 2015 at 1:40 PM, Ronald Cosentino wrote: > def funA(x,y,z): > return (x+y) * z > The above takes 3 values and returns a value > def funB(x,y): > return(x-y) > The above takes 2 values and returns a value > print(funA(4,funB(2,3), funB(3,2))) > you are printing the resu

function code snippet that has function calls I have never seen before. How does it work.

2015-10-03 Thread Ronald Cosentino
def funA(x,y,z): return (x+y) * z def funB(x,y): return(x-y) print(funA(4,funB(2,3), funB(3,2))) the answer is 3. I don't know how it works. -- https://mail.python.org/mailman/listinfo/python-list