Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!news.mixmin.net!news2.arglkargh.de!news.albasani.net!news.stack.nl!newsfeed.xs4all.nl!newsfeed6.news.xs4all.nl!xs4all!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.029 X-Spam-Evidence: '*H*': 0.94; '*S*': 0.00; 'syntax': 0.03; 'executed': 0.07; 'referring': 0.07; 'subject:code': 0.07; 'subject:two': 0.07; 'python': 0.09; 'subject:between': 0.16; 'subject:these': 0.16; 'wrote:': 0.17; 'pieces': 0.17; 'shell': 0.18; 'python?': 0.20; 'supposed': 0.21; "i'd": 0.22; 'second': 0.24; 'header:In- Reply-To:1': 0.25; 'header:User-Agent:1': 0.26; 'to?': 0.27; 'gary': 0.29; 'prints': 0.29; 'subject: ?': 0.30; 'error': 0.30; 'code': 0.31; '(2)': 0.32; 'to:addr:python-list': 0.33; 'version': 0.34; '(1)': 0.34; 'pm,': 0.35; 'two': 0.37; 'why': 0.37; 'science': 0.38; 'to:addr:python.org': 0.39; 'received:192': 0.39; 'received:192.168': 0.40; 'first': 0.61; 'between': 0.63; 'charset:windows-1252': 0.65; 'differences': 0.65; 'subject: ': 0.66; '12.': 0.71; 'dr.': 0.72; 'institute': 0.72; 'received:204': 0.72; 'subject::': 0.83; 'respectively': 0.84; 'subject:\x92': 0.84 Date: Fri, 06 Jul 2012 22:41:04 -0700 From: Gary Herron User-Agent: Mozilla/5.0 (X11; Linux i686; rv:13.0) Gecko/20120615 Thunderbird/13.0.1 MIME-Version: 1.0 To: python-list@python.org Subject: Re: =?windows-1252?Q?What=92s_the_differences_between_th?= =?windows-1252?Q?ese_two__pieces_of_code_=3F?= References: <48fbfc85-c495-4131-a18a-1ebb94e7ce20@googlegroups.com> In-Reply-To: <48fbfc85-c495-4131-a18a-1ebb94e7ce20@googlegroups.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: quoted-printable X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.12 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: 36 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1341640207 news.xs4all.nl 6850 [2001:888:2000:d::a6]:41301 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:25002 On 07/06/2012 09:56 PM, iMath wrote: > What=92s the differences between these two pieces of code ? > (1) > for i in range(1, 7): > print(2 * i, end=3D' ') > > > (2) > for i in range(1, 7): > print(2 * i, end=3D' ') > print() > > > when executed both respectively in Python shell ,I get the same effe= ct . Who can tell me why ? What "effect" are you referring to? What did you expect? What did you = get? What version of Python? (3 I'd guess). As for me, the first one fails because of a syntax (indentation) error=20 and the second prints the even numbers 2 through 12. What are we=20 supposed to be comparing? Gary Herron --=20 Dr. Gary Herron Department of Computer Science DigiPen Institute of Technology (425) 895-4418