Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!news2.arglkargh.de!news.mixmin.net!rt.uk.eu.org!newsfeed.xs4all.nl!newsfeed3.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.008 X-Spam-Evidence: '*H*': 0.98; '*S*': 0.00; 'url:pipermail': 0.05; 'arguments': 0.09; 'explanation': 0.09; 'python': 0.11; 'def': 0.12; '4:25': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'subject:String': 0.16; 'subject:object': 0.16; 'url:tutor': 0.16; 'wrote:': 0.18; 'wed,': 0.18; 'error': 0.23; 'passes': 0.24; 'skip:" 20': 0.27; 'header:In-Reply-To:1': 0.27; 'skip:p 30': 0.29; 'am,': 0.29; 'skip:( 40': 0.30; 'message- id:@mail.gmail.com': 0.30; "i'm": 0.30; 'getting': 0.31; 'url:python': 0.33; 'received:209.85': 0.35; 'received:209.85.220': 0.35; 'but': 0.35; 'received:google.com': 0.35; 'functions.': 0.36; 'url:org': 0.36; 'should': 0.36; 'received:209': 0.37; 'to:addr:python-list': 0.38; 'to:addr:python.org': 0.39; 'url:mail': 0.40; 'subject:"': 0.60; 'receive': 0.70; '2013': 0.98 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=MUbVK8PF0qPTZ2F19CwChwdRz2jT8zI24zJV1bt/Ijc=; b=FJcDAPfPSrRe9dwSOdz1hGL+oLvrYCJnUIHCPQTB6KWokyr3hBP+Srrjf/r4r4de5R t+BGL0EW+4fNSQAgPY9uEAETIVf7QpxCdGZS8SOitc2ihzeoQpcbE0LSIq/SU0E5YujV ti5GvhDeDzNU3a1eI6x2cG2AV+g4dc6/mAr+VkHy+FfYZN1MjPlMaz3RVTYm+3M+ICIr UXlSKuunQAxObSpYmgQp7JX+JPwUkgQc9qrMJalv/lm/SdrMjKY7Ytrg2j+5vwJtGN7X WMz6t2YQpZTKg41HrVjQkH64g81PWMp7yV1ILIjspHQUbQYfqPuVdt4GjBGMChKklsrt 91Nw== MIME-Version: 1.0 X-Received: by 10.67.4.196 with SMTP id cg4mr1929352pad.117.1369814078950; Wed, 29 May 2013 00:54:38 -0700 (PDT) In-Reply-To: <8d8143e8-74f3-43a0-9a52-06b60e857984@googlegroups.com> References: <8d8143e8-74f3-43a0-9a52-06b60e857984@googlegroups.com> Date: Wed, 29 May 2013 17:54:38 +1000 Subject: Re: String object has no attribute "append" From: Chris Angelico To: python-list@python.org Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 18 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1369814083 news.xs4all.nl 15921 [2001:888:2000:d::a6]:38394 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:46358 On Wed, May 29, 2013 at 4:25 AM, Matt Graves 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