Daiyue Weng wrote:
> i, I am new to the advanced python techniques, and by studying your code,
> I understand that when calling grouped function with values[1, 2, 3, 6, 8,
> 9, 10, 11, 13, 17, 19],
>
> tee(values, 3) generated 3 iterators shared values
>
> left contains [1, 2, 3, 6, 8, 9, 10, 11
On Thu, 22 Sep 2016 01:51 am, marco.naw...@colosso.nl wrote:
> And here is a straightforward one without any helpers:
Please don't do people's homework for them.
--
Steve
“Cheer up,” they said, “things could be worse.” So I cheered up, and sure
enough, things got worse.
--
https://mail.p
On Wednesday, September 21, 2016 at 4:14:10 PM UTC+2, Daiyue Weng wrote:
> Hi, first of all, let me rephase the problem.
>
> For an arbitrary list of integers (the integers in the list are not
> necessary to be sequential), e.g. [1,2,3,6,8,9,10,11,13],
>
> if a set of consecutive integers having
Peter Otten wrote:
> This is not as efficient as it should be -- the gaps are calculated twice,
> the check for the first and the last position is repeated on every
> iteration lots of packing and unpacking... --
To address some of my own criticism:
def lonely(triple):
left, value, right =
Daiyue Weng wrote:
> Hi, first of all, let me rephase the problem.
>
> For an arbitrary list of integers (the integers in the list are not
> necessary to be sequential), e.g. [1,2,3,6,8,9,10,11,13],
>
> if a set of consecutive integers having a difference of 1 between them,
> put them in a list,
Hi, first of all, let me rephase the problem.
For an arbitrary list of integers (the integers in the list are not
necessary to be sequential), e.g. [1,2,3,6,8,9,10,11,13],
if a set of consecutive integers having a difference of 1 between them, put
them in a list, i.e. there are two such lists in
On 20/09/2016 12:52, Daiyue Weng wrote:
Hi, I have a list numbers say,
[1,2,3,4,6,8,9,10,11]
First, I want to calculate the sum of the differences between the numbers
in the list.
At least for this first part a little pencil, paper and algebra yields a
simple formula of constant and minimal c
On 20/09/2016 12:52, Daiyue Weng wrote:
What's the best way to implement this?
With a python script.
Show your work and people will help you.
--
https://mail.python.org/mailman/listinfo/python-list
Daiyue Weng wrote:
> Hi, I have a list numbers say,
>
> [1,2,3,4,6,8,9,10,11]
>
> First, I want to calculate the sum of the differences between the numbers
> in the list.
> Second, if a sequence of numbers having a difference of 1, put them in a
> list, i.e. there are two such lists,
>
> [1,2,3
On Tue, 20 Sep 2016 09:52 pm, Daiyue Weng wrote:
> Hi, I have a list numbers say,
>
> [1,2,3,4,6,8,9,10,11]
>
> First, I want to calculate the sum of the differences between the numbers
> in the list.
Sounds like homework. What have you tried?
Hint: use the sum() function to sum a list of num
Hi, I have a list numbers say,
[1,2,3,4,6,8,9,10,11]
First, I want to calculate the sum of the differences between the numbers
in the list.
Second, if a sequence of numbers having a difference of 1, put them in a
list, i.e. there are two such lists,
[1,2,3]
[8,9,10,11]
and also put the rest nu
11 matches
Mail list logo