On Sunday, September 30, 2012 1:19:22 AM UTC+8, Ian wrote:
> On Sat, Sep 29, 2012 at 11:01 AM, 8 Dihedral
>
> wrote:
>
> >
>
> > Don't you get it why I avoided the lambda one liner as a functon.
>
> >
>
> > I prefer the def way with a name chosen.
>
>
>
> Certainly, but the Bresenham l
On Sun, Sep 30, 2012 at 3:18 AM, Ian Kelly wrote:
> On Sat, Sep 29, 2012 at 11:01 AM, 8 Dihedral
> wrote:
>>
>> Don't you get it why I avoided the lambda one liner as a functon.
>>
>> I prefer the def way with a name chosen.
>
> Certainly, but the Bresenham line algorithm is O(n), which is wh
On Sat, Sep 29, 2012 at 11:01 AM, 8 Dihedral
wrote:
>
> Don't you get it why I avoided the lambda one liner as a functon.
>
> I prefer the def way with a name chosen.
Certainly, but the Bresenham line algorithm is O(n), which is why it
is so superior to quicksort that is O(n log n). Of cours
On Saturday, September 29, 2012 9:46:22 PM UTC+8, Ramchandra Apte wrote:
> On Thursday, 27 September 2012 04:14:42 UTC+5:30, Tim Chase wrote:
>
> > On 09/26/12 17:28, 8 Dihedral wrote:
>
> >
>
> > > 8 Dihedral於 2012年9月27日星期四UTC+8上午6時07分35秒寫道:
>
> >
>
> > In these conditions, ho
On Thursday, 27 September 2012 04:14:42 UTC+5:30, Tim Chase wrote:
> On 09/26/12 17:28, 8 Dihedral wrote:
>
> > 8 Dihedral於 2012年9月27日星期四UTC+8上午6時07分35秒寫道:
>
> In these conditions, how to make this list [[0,0,0],[0,0,0]] with "*"
>
> without this behavior?
>
> >>> >>> a
Tim Chase於 2012年9月27日星期四UTC+8上午6時44分42秒寫道:
> On 09/26/12 17:28, 8 Dihedral wrote:
>
> > 8 Dihedral於 2012年9月27日星期四UTC+8上午6時07分35秒寫道:
>
> In these conditions, how to make this list [[0,0,0],[0,0,0]] with "*"
>
> without this behavior?
>
> >>> >>> a = [[0]*3 for i in xrange(
Tim Chase於 2012年9月27日星期四UTC+8上午6時44分42秒寫道:
> On 09/26/12 17:28, 8 Dihedral wrote:
>
> > 8 Dihedral於 2012年9月27日星期四UTC+8上午6時07分35秒寫道:
>
> In these conditions, how to make this list [[0,0,0],[0,0,0]] with "*"
>
> without this behavior?
>
> >>> >>> a = [[0]*3 for i in xrange(
On 09/26/12 17:28, 8 Dihedral wrote:
> 8 Dihedral於 2012年9月27日星期四UTC+8上午6時07分35秒寫道:
In these conditions, how to make this list [[0,0,0],[0,0,0]] with "*"
without this behavior?
>>> >>> a = [[0]*3 for i in xrange(2)]
>>> >>> a[0][0]=2
>>> >>> a
>>> [[2, 0, 0], [0, 0
8 Dihedral於 2012年9月27日星期四UTC+8上午6時07分35秒寫道:
> Paul Rubin於 2012年9月27日星期四UTC+8上午5時43分58秒寫道:
>
> > TP writes:
>
> >
>
> > > copies a list, he copies in fact the *pointer* to the list
>
> >
>
> > > Is it the correct explanation?
>
> >
>
> >
>
> >
>
> > Yes, that is correct.
>
>
Paul Rubin於 2012年9月27日星期四UTC+8上午5時43分58秒寫道:
> TP writes:
>
> > copies a list, he copies in fact the *pointer* to the list
>
> > Is it the correct explanation?
>
>
>
> Yes, that is correct.
>
>
>
> > In these conditions, how to make this list [[0,0,0],[0,0,0]] with "*"
>
> > without
TP於 2012年9月27日星期四UTC+8上午5時25分04秒寫道:
> Hi everybody,
>
>
>
> I have tried, naively, to do the following, so as to make lists quickly:
>
>
>
> >>> a=[0]*2
>
> >>> a
>
> [0, 0]
>
> >>> a[0]=3
>
> >>> a
>
> [3, 0]
>
>
>
> All is working fine, so I extended the technique to do:
>
>
>
>
TP writes:
> copies a list, he copies in fact the *pointer* to the list
> Is it the correct explanation?
Yes, that is correct.
> In these conditions, how to make this list [[0,0,0],[0,0,0]] with "*"
> without this behavior?
>>> a = [[0]*3 for i in xrange(2)]
>>> a[0][0]=2
>>>
On Wed, Sep 26, 2012 at 3:20 PM, TP wrote:
> Hi everybody,
>
> I have tried, naively, to do the following, so as to make lists quickly:
>
a=[0]*2
a
> [0, 0]
a[0]=3
a
> [3, 0]
>
> All is working fine, so I extended the technique to do:
>
a=[[0]*3]*2
a
> [[0, 0, 0], [0,
Hi everybody,
I have tried, naively, to do the following, so as to make lists quickly:
>>> a=[0]*2
>>> a
[0, 0]
>>> a[0]=3
>>> a
[3, 0]
All is working fine, so I extended the technique to do:
>>> a=[[0]*3]*2
>>> a
[[0, 0, 0], [0, 0, 0]]
>>> a[0][0]=2
>>> a
[[2, 0, 0], [2, 0, 0]]
The behavior i
14 matches
Mail list logo