Re: append function problem?
Available news archives: comp.lang.tcl - comp.lang.python - comp.security.firewalls - sci.crypt - comp.lang.php - comp.lang.javascript
Google
 
Web news.hping.org


comp.lang.python archive

Re: append function problem?

From: *binarystar* <newsgroup_mail...@...binarystar.org>
Date: Fri Apr 28 2006 - 08:19:50 CEST

# Try This
seed = [2, 3, 4, 5]
next = [7]
seed1 = seed + next

randomtalk@gmail.com wrote:
> hello, recently i tried to use list.append() function in seemingly
> logical ways, however, i cannot get it to work, here is the test code:
>
>>>> seed = [2, 3, 4, 5]
>>>> next = 7
>>>> seed1 = seed.append(next)
>>>> seed1
>>>> print(str(seed1))
> None
>>>> def test(lst):
> ... print(str(lst))
> ...
>>>> test(seed.append(next))
> None
>
> I'm using Activestate python (latest) on win xp sp2..
>
> I'm not sure why seed1 and the function doesn't recognize the list..
>
> If anyone can point out where i'm going wrong would be much
> appreciated!
> Thanks in advance!
>
Received on Mon May 1 00:35:47 2006