Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!news.albasani.net!feeder.erje.net!1.eu.feeder.erje.net!newsfeed.xs4all.nl!newsfeed4a.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.033 X-Spam-Evidence: '*H*': 0.93; '*S*': 0.00; 'string.': 0.04; 'python': 0.11; 'syntax': 0.13; 'output': 0.15; 'gently': 0.16; 'iterator': 0.16; 'wrote:': 0.16; '(on': 0.22; '2.x': 0.22; 'fixing': 0.22; 'lawrence': 0.22; '2015': 0.23; "i've": 0.24; 'header:In-Reply- To:1': 0.24; 'tim': 0.24; 'error': 0.27; 'message- id:@mail.gmail.com': 0.28; 'colon': 0.29; 'e.g.': 0.31; 'to:name :python-list': 0.31; 'print': 0.31; 'subject:use': 0.33; 'received:google.com': 0.34; 'to:addr:python-list': 0.35; 'done': 0.35; 'something': 0.35; 'statement': 0.36; 'should': 0.37; 'subject:: ': 0.37; 'instead': 0.38; 'end': 0.39; 'to:addr:python.org': 0.39; 'mark': 0.40; 'back': 0.61; 'per': 0.61; 'to,': 0.63; 'complete': 0.63; 'reverse': 0.66; 'delaney': 0.84 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=kD1WDFKH1etPn9l7afl2WBBCmcLx/r/qrFmLjz65Qi8=; b=gj6Ju81OF9apLJXFyV+Q2udVSaFgNX18EyFZC4a9Xr1EEOEgXDXr/vaaJbtxMm91kZ QHa9WUJQjuH79zAEOSSWoPE6ZIsfur11npBm59yACajYaUeETw6h3YA2pgUQFyjtbzaE 11hYwybfjh1yscT3maxY2MpE0825a89SlSNX+UO9bauxysP7BN1zqxG8x35qDy2KxnbD uKRXTcvocbmQ3rQ1l6xQCGSgqClhVGqEhCr+STeVYPNC4rjciP6N7gEX/p6h3vyNTvsC +merPcQQ93/T7rt795Mzwmt4pP07aC7VYpfwUSKSgUFYFzmikaqiqR0HuNYzBszuhq+I 8Nqg== MIME-Version: 1.0 X-Received: by 10.194.90.100 with SMTP id bv4mr35930665wjb.143.1433131141573; Sun, 31 May 2015 20:59:01 -0700 (PDT) In-Reply-To: References: <514c05fc-dded-4278-ac86-3e8e3cd0e851@googlegroups.com> Date: Mon, 1 Jun 2015 13:59:01 +1000 Subject: Re: What use for reversed()? From: Tim Delaney To: Python-List Content-Type: multipart/alternative; boundary=047d7bfceb069c33af05176cd8b7 X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.20+ 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: 66 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1433133429 news.xs4all.nl 2931 [2001:888:2000:d::a6]:48793 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:91616 --047d7bfceb069c33af05176cd8b7 Content-Type: text/plain; charset=UTF-8 On 1 June 2015 at 10:30, Mark Lawrence wrote: > On 01/06/2015 00:23, Tim Delaney wrote: > >> The for statement must have a colon at the end of line e.g. a complete >> for statement and block is: >> >> for br in b: >> print br >> >> This will output the characters one per line (on Python 3.x), since that >> is what the reversed() iterator will return. You will need to do >> something else to get it back to a single string. >> > > Will it indeed? Perhaps fixing the syntax error will get something to > print :) Indeed - as Mark is so gently alluding to, I've done the reverse of what I said - given Python 2.x syntax instead of Python 3.x. That should have been: for br in b: print(br) Tim Delaney --047d7bfceb069c33af05176cd8b7 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
On 1= June 2015 at 10:30, Mark Lawrence <breamoreboy@yahoo.co.uk><= /span> wrote:
On 01/06/2015 00:23, Tim= Delaney wrote:
The for statement must have a colo= n at the end of line e.g. a complete
for statement and block is:

for br in b:
=C2=A0 =C2=A0 =C2=A0print br

This will output the characters one per line (on Python 3.x), since that is what the reversed() iterator will return. You will need to do
something else to get it back to a single string.

Will it indeed?=C2=A0 Perhaps fixing the syntax error will get something to= print :)

Indeed - as Mark is so gently all= uding to, I've done the reverse of what I said - given Python 2.x synta= x instead of Python 3.x.

That should have been:

for br in b:
=C2=A0 =C2=A0 =C2=A0print(br)

Tim Delaney=C2=A0
--047d7bfceb069c33af05176cd8b7--