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
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)
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
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
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
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