Re: Hi am new to python

2015-09-09 Thread alister
On Tue, 08 Sep 2015 17:44:26 -0500, Nassim Gannoun wrote: > Hi I'm also new to Python but would like to reply. > Like others have stated there is a built in function (sum) that can give > the sum of the elements of a list, but if what you are trying to do is > learn how to use the while command

Re: Hi am new to python

2015-09-09 Thread Denis McMahon
On Tue, 08 Sep 2015 17:44:26 -0500, Nassim Gannoun wrote: > My question is in a while loop; how do l sum all the numbers in the > given list (list_a)? You don't normally use a while loop or a counter to iterate over a list. Such a question should only be used as a precursor to discussing better

Re: Hi am new to python

2015-09-09 Thread Emile van Sebille
On 9/9/2015 3:35 PM, Denis McMahon wrote: On Tue, 08 Sep 2015 17:44:26 -0500, Nassim Gannoun wrote: My question is in a while loop; how do l sum all the numbers in the given list (list_a)? You don't normally use a while loop or a counter to iterate over a list. Such a question should only be

Hi am new to python

2015-08-31 Thread Chubasco Diranga
Can anyone please help me with the following please? My question is in a while loop; how do l sum all the numbers in the given list (list_a)? list_a = [8, 5, 2, 4] sum_a = 0 # for storing the sum of list_a i = 0 # for looping through the list_a# Use a while loop to sum all numbers in list_a#

Re: Hi am new to python

2015-08-31 Thread Ian Kelly
On Mon, Aug 31, 2015 at 5:27 PM, Chubasco Diranga wrote: > Can anyone please help me with the following please? > > My question is in a while loop; how do l sum all the numbers in the given > list (list_a)? > > list_a = [8, 5, 2, 4] > sum_a = 0 # for storing the sum of

Re: Hi am new to python

2015-08-31 Thread Emile van Sebille
On 8/31/2015 4:27 PM, Chubasco Diranga wrote: Can anyone please help me with the following please? My question is in a while loop; how do l sum all the numbers in the given list (list_a)? list_a = [8, 5, 2, 4] sum_a = 0 # for storing the sum of list_a i = 0 # for looping through the list_a#

Re: Hi am new to python

2015-08-31 Thread Chris Angelico
On Tue, Sep 1, 2015 at 9:27 AM, Chubasco Diranga wrote: > Can anyone please help me with the following please? > > My question is in a while loop; how do l sum all the numbers in the given > list (list_a)? > > list_a = [8, 5, 2, 4] > sum_a = 0 # for storing the sum of list_a

Re: Hi am new to python

2015-08-31 Thread Ben Finney
Chubasco Diranga writes: > Can anyone please help me with the following please? Welcome! Is this a homework assignment? It's okay to ask for help with those, but we're not going to do the work for you. > My question is in a while loop; how do l sum all the numbers in the