Hi am new to python

Emile van Sebille emile at fenx.com
Wed Sep 9 19:16:40 EDT 2015


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 used as a precursor to discussing better
> methods of achieving the required result.

As I understand it, the OP was given the homework assignment to sum up a 
list of numbers using while.  Too bad he didn't also specify using 
binary operators along with while.  :)

Emile








More information about the Python-list mailing list