[sf-lug] [PYCLASS] Session 3: Monday Oct 6

jim jim at well.com
Sat Oct 4 08:58:59 PDT 2008


   not necessarily. write the functions 
(at top) then call them as you need them 
for each specific arithmetic requirement. 
   how elegantly to combine the results 
of multiple calls for a single arithmetic 
result seems elusive: i don't like the 
summing idea, though i can't say why 
(probably gut feel desire for a single 
does_all() function call). 

def do_twice(value, recdepth): 
    # la la la 

answer = do_twice(6,3) + do_twice(6,2) + do_once(6) 


On Sat, 2008-10-04 at 07:43 -0700, Alex Kleider wrote:
> --- On Fri, 10/3/08, jim <jim at well.com> wrote:
>  a very crude iterative tool is provided 
> > in the functions that take function names 
> > and then repeat them some specific number 
> > of times. 
> >    would have been interesting to explore 
> > a do_twice() function that can be called 
> > recursively, which would handle (powers of 
> > two) times (doing something) repeatedly. 
> > you want 13? somehow combine 
> > do_twice(depth = 3) with do_twice(depth = 2) 
> > with do_once(). 
> >    not that i've coded it. 
> 
> Would not your proposed solution require an if statement?
> (which is still as of this lesson not available to us.)
> 
> 
> 
>       
> 
> _______________________________________________
> sf-lug mailing list
> sf-lug at linuxmafia.com
> http://linuxmafia.com/mailman/listinfo/sf-lug
> 





More information about the sf-lug mailing list