[Tutor] calculate percents of items in a list

Dave Angel davea at davea.name
Mon Sep 1 01:31:13 CEST 2014


LN A-go-go <lnartist at yahoo.com.dmarc.invalid> Wrote in message:
> 

Please post in text mode. It's a real pain trying to respond to
 the memory of your post.


sum () is a built-in function that will add all the floats in CL.
 Of course you can't use it after you've overloaded it with a new
 meaning. 

In your loop, you refer to CL [0] when you probably mean i. 

You also increment some variable in that loop when you're not using it.

Next you have a complicated expression that calls float () twice
 on values that are already floats.

As you've already been told, it'd be nice to show us the result
 you got, and the result you expected. 

-- 
DaveA



More information about the Tutor mailing list