Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #46358

Re: String object has no attribute "append"

References <8d8143e8-74f3-43a0-9a52-06b60e857984@googlegroups.com>
Date 2013-05-29 17:54 +1000
Subject Re: String object has no attribute "append"
From Chris Angelico <rosuav@gmail.com>
Newsgroups comp.lang.python
Message-ID <mailman.2343.1369814083.3114.python-list@python.org> (permalink)

Show all headers | View raw


On Wed, May 29, 2013 at 4:25 AM, Matt Graves <tunacubes@gmail.com> wrote:
> I receive this error while toying around with Functions...
>
> def pulldata(speclist,speccolumn):
>                  (speclist).append(column[('speccolumn')])
>
> pulldata(speclist = 'numbers', speccolumn = "0")
>
> I'm getting the error because it should say "numbers.append", but it is reading it as "(speclist).append".

Others have answered the immediate problem, but you may find this a
worthwhile read:

http://mail.python.org/pipermail/tutor/2010-December/080505.html

It's an excellent explanation of the way Python passes arguments to functions.

ChrisA

Back to comp.lang.python | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

String object has no attribute "append" Matt Graves <tunacubes@gmail.com> - 2013-05-28 11:25 -0700
  Re: String object has no attribute "append" "marduk@python.net" <marduk@python.net> - 2013-05-28 14:40 -0400
  Re: String object has no attribute "append" Ian Kelly <ian.g.kelly@gmail.com> - 2013-05-28 12:41 -0600
  Re: String object has no attribute "append" Ian Kelly <ian.g.kelly@gmail.com> - 2013-05-28 12:43 -0600
  Re: String object has no attribute "append" Chris Angelico <rosuav@gmail.com> - 2013-05-29 17:54 +1000

csiph-web