En Mon, 30 Mar 2009 13:19:57 -0300, TP
escribió:
Adrian Dziubek wrote:
Could you explain your high level goal for this? It looks like a very
wicked way of doing things. Have You tried to read the list methods'
documentation? Maybe there you find something you need (like
list.index)?
I have
Adrian Dziubek wrote:
> Could you explain your high level goal for this? It looks like a very
> wicked way of doing things. Have You tried to read the list methods'
> documentation? Maybe there you find something you need (like
> list.index)?
Hello,
I have a "disambiguation" function that modifi
On Mar 27, 4:39 am, TP wrote:
> Hi everybody,
>
> Be a the following list, containing list elements which second field is a
> string.
>
> >>> a = [ [4, "toto"], [5, "cou"] ]
> >>> a[0][1]="tou"
> >>> a
>
> [[4, 'tou'], [5, 'cou']]
>
> OK.
>
> Now, I want:
> * to do the same modification on the lis
Could you explain your high level goal for this? It looks like a very
wicked way of doing things. Have You tried to read the list methods'
documentation? Maybe there you find something you need (like
list.index)?
--
Adrian
--
http://mail.python.org/mailman/listinfo/python-list
> * to do the same modification on the list "a" within a function
> * not to hardcode in this function the position of the string in each
>>> a = [ [4, "toto"], [5, "cou"] ]
>>> def assign(element,pos,newValue):
... element[pos]=newValue
...
>>> assign(a[0],1,'xxx')
>>> print a
[[4, 'xxx'],
TP wrote:
> Hi everybody,
>
> Be a the following list, containing list elements which second field is a
> string.
>
a = [ [4, "toto"], [5, "cou"] ]
a[0][1]="tou"
a
> [[4, 'tou'], [5, 'cou']]
>
> OK.
>
> Now, I want:
> * to do the same modification on the list "a" within a functi
Hi everybody,
Be a the following list, containing list elements which second field is a
string.
>>> a = [ [4, "toto"], [5, "cou"] ]
>>> a[0][1]="tou"
>>> a
[[4, 'tou'], [5, 'cou']]
OK.
Now, I want:
* to do the same modification on the list "a" within a function
* not to hardcode in this functio