Please take a look at 2 functions I just wrote to calculate the
harmonic and geometric means of lists of positive numbers:
<http://tutoree7.pastebin.com/VhUnZcma>.

Both Hlist and Glist must contain only positive numbers, so I really
need to test for this inside each function. But is there a good way to
do this? What should the functions return should a non-positive number
be detected? Is there a conventional Pythonic way to do this?

Thanks,

Dick Moores
_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor

Reply via email to