Re: [Tutor] range question

2011-09-22 Thread James Reynolds
On Thu, Sep 22, 2011 at 11:08 AM, Steven D'Aprano wrote: > Joel Knoll wrote: > >> Given a range of integers (1,n), how might I go about printing them in the >> following patterns: >> 1 2 3 4 ... n2 3 4 5 ... n 13 4 5 6 ... n 1 2 etc., e.g. for a "magic >> square". So that for the range (1,5) for e

Re: [Tutor] range question

2011-09-22 Thread Steven D'Aprano
Joel Knoll wrote: Given a range of integers (1,n), how might I go about printing them in the following patterns: 1 2 3 4 ... n2 3 4 5 ... n 13 4 5 6 ... n 1 2 etc., e.g. for a "magic square". So that for the range (1,5) for example I would get 1 2 3 42 3 4 13 4 1 24 1 2 3 I'm not sure what

Re: [Tutor] range question

2011-09-22 Thread Hugo Arts
On Thu, Sep 22, 2011 at 4:56 PM, Dave Angel wrote: > > The second correction is important, the first one wrong.  The OP's example > was looking for the numbers 1 through 4, so range(1,5) was correct. > -- > > DaveA > > Ah, apologies. I misread the OP __

Re: [Tutor] range question

2011-09-22 Thread Dave Angel
On 09/22/2011 10:43 AM, Hugo Arts wrote: forgot to forward to list: From: Hugo Arts Date: Thu, Sep 22, 2011 at 4:42 PM Subject: Re: [Tutor] range question To: d...@davea.name On Thu, Sep 22, 2011 at 4:37 PM, Dave Angel wrote: On 09/22/2011 10:27 AM, Joel Knoll wrote: Given a range of

Re: [Tutor] range question

2011-09-22 Thread Joel Goldstick
On Thu, Sep 22, 2011 at 10:37 AM, Dave Angel wrote: > ** > On 09/22/2011 10:27 AM, Joel Knoll wrote: > > Given a range of integers (1,n), how might I go about printing them in the > following patterns: > 1 2 3 4 ... n2 3 4 5 ... n 13 4 5 6 ... n 1 2 > etc., e.g. for a "magic square". So that for

[Tutor] range question

2011-09-22 Thread Hugo Arts
forgot to forward to list: From: Hugo Arts Date: Thu, Sep 22, 2011 at 4:42 PM Subject: Re: [Tutor] range question To: d...@davea.name On Thu, Sep 22, 2011 at 4:37 PM, Dave Angel wrote: > On 09/22/2011 10:27 AM, Joel Knoll wrote: > > Given a range of integers (1,n), how might I

Re: [Tutor] range question

2011-09-22 Thread Dave Angel
On 09/22/2011 10:27 AM, Joel Knoll wrote: Given a range of integers (1,n), how might I go about printing them in the following patterns: 1 2 3 4 ... n2 3 4 5 ... n 13 4 5 6 ... n 1 2 etc., e.g. for a "magic square". So that for the range (1,5) for example I would get 1 2 3 42 3 4 13 4 1 24 1 2

Re: [Tutor] range question

2011-09-22 Thread James Reynolds
On Thu, Sep 22, 2011 at 10:27 AM, Joel Knoll wrote: > Given a range of integers (1,n), how might I go about printing them in the > following patterns: > > 1 2 3 4 ... n > 2 3 4 5 ... n 1 > 3 4 5 6 ... n 1 2 > > etc., e.g. for a "magic square". So that for the range (1,5) for example I > would ge

[Tutor] range question

2011-09-22 Thread Joel Knoll
Given a range of integers (1,n), how might I go about printing them in the following patterns: 1 2 3 4 ... n2 3 4 5 ... n 13 4 5 6 ... n 1 2 etc., e.g. for a "magic square". So that for the range (1,5) for example I would get 1 2 3 42 3 4 13 4 1 24 1 2 3 I just cannot figure out how to make the