Hi all, I am working a simple function and want it return a
a float
a list
and a dictionary
But it seems that I can only use return once in the function cant see to figure out why I can return more than once? Thanks for the help!
'return' does two things - it specifies what values to return, and it exits the function. You can return as many values as you want but it has to be all from one return statement.
return InitalCoumadinWeekRegimen
return reduce ((lambda x,y: x+y), CoumadinValuesList), CoumadinValuesList
Just put all the values in one return: return InitalCoumadinWeekRegimen, reduce ((lambda x,y: x+y), CoumadinValuesList), CoumadinValuesList
BTW reduce ((lambda x,y: x+y), CoumadinValuesList) is the same as sum(CoumadinValuesList)
Kent
_______________________________________________ Tutor maillist - [email protected] http://mail.python.org/mailman/listinfo/tutor
