Search the difference: Why this function defenition does'nt work?

Aahz Maruch aahz at panix.com
Sun Dec 23 12:41:21 EST 2001


In article <3C260A92.5030907 at student.kun.nl>,
husam  <h.jehadalwan at student.kun.nl> wrote:
>
>I'm not trying to add string to a list of integeres. What I wanted to do 
>is to add each argument of func2('a','b','c') to sum=['e']. Since sum is 
>a list of chars, and the arguments are accessable as a sequence, one 
>would expect that the addition operation would be correct. On the 
>interactive shell, it is a trivial operation. But, only when i use it in 
>the function defenition i get problems. Adding 'a' to ['b'] does not 
>work, but adding list('a') to ['b'] it does, so, i thought that this 
>might help my code, but converting the args to a list did not helpe 
>either . I really didn't get yet!

use list.append()
-- 
                      --- Aahz  <*>  (Copyright 2001 by aahz at pobox.com)

Hugs and backrubs -- I break Rule 6                 http://www.rahul.net/aahz/
Androgynous poly kinky vanilla queer het Pythonista   

Tenth Virtual Anniversary: 8 days and counting



More information about the Python-list mailing list