Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #96231

Re: Hi am new to python

From Emile van Sebille <emile@fenx.com>
Subject Re: Hi am new to python
Date 2015-09-09 16:16 -0700
References <mailman.265.1441798120.8327.python-list@python.org> <msqc85$l6g$4@dont-email.me>
Newsgroups comp.lang.python
Message-ID <mailman.297.1441840642.8327.python-list@python.org> (permalink)

Show all headers | View raw


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




Back to comp.lang.python | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

Re: Hi am new to python Denis McMahon <denismfmcmahon@gmail.com> - 2015-09-09 22:35 +0000
  Re: Hi am new to python Emile van Sebille <emile@fenx.com> - 2015-09-09 16:16 -0700

csiph-web