Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!xlned.com!feeder3.xlned.com!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.009 X-Spam-Evidence: '*H*': 0.98; '*S*': 0.00; 'syntax': 0.04; 'function,': 0.09; 'subject:Function': 0.09; 'subject:Number': 0.09; 'python': 0.11; 'def': 0.12; '2):': 0.16; 'ian.': 0.16; 'range(0,': 0.16; 'subject: \n ': 0.16; 'wrote:': 0.18; 'thu,': 0.19; '>>>': 0.22; 'issue.': 0.22; 'print': 0.22; 'header:In- Reply-To:1': 0.27; 'statement': 0.30; 'message- id:@mail.gmail.com': 0.30; 'subject:that': 0.31; 'worked': 0.33; 'something': 0.35; 'received:google.com': 0.35; 'thanks': 0.36; 'to:addr:python-list': 0.38; 'issue': 0.38; 'pm,': 0.38; 'to:addr:python.org': 0.39; 'changed': 0.39; 'skip:u 10': 0.60; 'invalid': 0.68; 'jul': 0.74; '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:from:date:message-id:subject:to :content-type; bh=i01/4aZQ96+Dd1ui5D2pO3B4jscwuIgrwyhnd2Rasy8=; b=YslU4TqeLK49cpv2oaWGCmVEO/RZSZkneJTqaOIOjRM3t5YdrdunVYH+zjAThTkjYa e2M0usVzCMpPH4j+A7vwROBqFji9IamUdfPn6BAfnrlVPlkufh6c+a/sZ9RcEj9ji9NJ 0CKsJx0+4NAFc57bD8wozwOZrmpfezAGaznnhJn/209LfcW0Hy+9g8oYE28kKn8K5MYE RIDmZXKP2RcOkcan2g6WSqOQJnH2bEPG2aaug91qSEk4fYaCGosxus/Dl4EqbaK+ZTzx pKHfwkTVvP2J6ZXSlbAU8qHkVDxP9HXZdSnvqxLA6ck4avKkckoWkTdjQUrgNYDnUFo4 ADfg== X-Received: by 10.58.227.198 with SMTP id sc6mr4927672vec.59.1374191012613; Thu, 18 Jul 2013 16:43:32 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: <8c5f6217-0029-481f-9bb0-dab1b34180df@googlegroups.com> References: <8a23cbf1-3cfd-48e3-a460-64551119fde7@googlegroups.com> <537e9d19-6587-4773-8910-df4005505653@googlegroups.com> <8c5f6217-0029-481f-9bb0-dab1b34180df@googlegroups.com> From: Ian Kelly Date: Thu, 18 Jul 2013 17:42:52 -0600 Subject: Re: Creating a Program to Decompose a Number and Run a Function on that Decomposition To: Python 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: 16 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1374191021 news.xs4all.nl 15999 [2001:888:2000:d::a6]:46905 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:50876 On Thu, Jul 18, 2013 at 5:04 PM, CTSB01 wrote: > 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? Are you using Python 2 or 3? "print" has changed from a statement to a function, so the above syntax would be invalid in Python 3.