Re: [Tutor] calculate percents of items in a list

2014-08-31 Thread Steven D'Aprano
Hello, You seem to have deliberately set the Reply-To header for replies to go back to you, instead of allowing them to go to the mailing list for others to take part in the conversation. I don't know if that was you personally, or just another sign of the major suckage that is Yahoo mail, but

Re: [Tutor] calculate percents of items in a list

2014-08-31 Thread Steven D'Aprano
On Sun, Aug 31, 2014 at 07:31:13PM -0400, Dave Angel wrote: > LN A-go-go Wrote in message: > > > > Please post in text mode. It's a real pain trying to respond to > the memory of your post. LN did post in text mode. Perhaps your email or news client is unable to deal with standard multipart/a

Re: [Tutor] calculate percents of items in a list

2014-08-31 Thread Dave Angel
LN A-go-go 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

Re: [Tutor] calculate percents of items in a list

2014-08-31 Thread Danny Yoo
On Aug 31, 2014 11:34 AM, "LN A-go-go" wrote: > > > What would be a better way to calculate percentages of items in a list? > please > Without showing us your code, try to explain a few examples of the problem you're trying to solve, and show us expected answer. The problem of just showing co

[Tutor] calculate percents of items in a list

2014-08-31 Thread LN A-go-go
What would be a better way to calculate percentages of items in a list? please CountList = [9221382, 10374466, 5192905, 1710238, 3359] CL = [float(i) for i in CountList] CL sum = CL[0] + CL[1] + CL[2] + CL[3] + CL[4] import math perList = [] n = 0 def percentage(CL,sum): for i in CL: P