Path: csiph.com!usenet.pasdenom.info!news.albasani.net!newsfeed.freenet.ag!news2.euro.net!newsgate.cistron.nl!newsgate.news.xs4all.nl!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.001 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'python.': 0.02; 'continuation': 0.07; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'subject:Function': 0.09; 'subject:Number': 0.09; 'python': 0.11; 'def': 0.12; '"..."': 0.16; '2):': 0.16; 'ian.': 0.16; 'interpreter,': 0.16; 'parentheses': 0.16; 'range(0,': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'subject: \n ': 0.16; 'token,': 0.16; 'traceback.': 0.16; 'thursday,': 0.16; 'wrote:': 0.18; 'code.': 0.18; '>>>': 0.22; 'issue.': 0.22; 'print': 0.22; 'header :User-Agent:1': 0.23; 'error': 0.23; 'pointer': 0.24; 'url:moin': 0.24; 'this:': 0.26; 'second': 0.26; 'header:X-Complaints-To:1': 0.27; 'header:In-Reply-To:1': 0.27; 'url:wiki': 0.31; '"",': 0.31; '3.x': 0.31; 'subject:that': 0.31; 'file': 0.32; 'worked': 0.33; 'url:python': 0.33; 'running': 0.33; 'actual': 0.34; 'something': 0.35; 'next': 0.36; 'thanks': 0.36; 'url:org': 0.36; 'to:addr :python-list': 0.38; 'issue': 0.38; 'pm,': 0.38; 'to:addr:python.org': 0.39; 'received:org': 0.40; 'skip:u 10': 0.60; 'ian': 0.60; "you're": 0.61; 'july': 0.63; 'prompt': 0.68; 'jul': 0.74; 'obvious': 0.74; 'forgotten': 0.91; 'hand,': 0.93; '2013': 0.98 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Dave Angel Subject: Re: Creating a Program to Decompose a Number and Run a Function on that Decomposition Date: Thu, 18 Jul 2013 19:49:19 -0400 References: <8a23cbf1-3cfd-48e3-a460-64551119fde7@googlegroups.com> <537e9d19-6587-4773-8910-df4005505653@googlegroups.com> <8c5f6217-0029-481f-9bb0-dab1b34180df@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Gmane-NNTP-Posting-Host: 174.32.174.33 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130623 Thunderbird/17.0.7 In-Reply-To: <8c5f6217-0029-481f-9bb0-dab1b34180df@googlegroups.com> 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: 47 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1374191380 news.xs4all.nl 15920 [2001:888:2000:d::a6]:51980 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:50879 On 07/18/2013 07:04 PM, CTSB01 wrote: > On Thursday, July 18, 2013 6:49:03 PM UTC-4, Ian wrote: >> On Jul 18, 2013 4:23 PM, "CTSB01" wrote: >> >>> >> >>> File "", line 2 >> >>> ... rtn = [] >> >>> ^ >> >> The "..." is the continuation prompt from the interactive interpreter, not part of the code. Don't paste it into Python. > > Thanks Ian. That worked regarding that issue. Now I have an 'invalid syntax' issue unfortunately. > >>> def phi_m(x,m): > rtn = [] > for n2 in range(0, len(x)*m - 2): > n = n2 / m > r = n2 - n * m > rtn.append(m * x[n] + r * (x[n + 1] - x[n])) > print 'n2 =', n2, ': n =', n, ' r =' , r, ' rtn =', rtn > rtn > > on the line print 'n2 =', n2, ': n =', n, ' r =' , r, ' rtn =', rtn Is it something obvious? > It's only obvious if you're using Python 3.x. You have forgotten the parentheses in the call to the print() function. On the other hand, if this is Python 2.x, I have no idea. Next time, please paste the actual error, not paraphrased. The error message includes a traceback. and a pointer to where in the line the error was detected. If it's pointing at the end of the second token, you must be running Python 3.x And since you're using that annoying googlegroups, see this: http://wiki.python.org/moin/GoogleGroupsPython -- DaveA