Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!news.albasani.net!weretis.net!feeder4.news.weretis.net!feeds.phibee-telecom.net!newsfeed.xs4all.nl!newsfeed3a.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.016 X-Spam-Evidence: '*H*': 0.97; '*S*': 0.00; 'output': 0.05; 'that?': 0.05; 'subject:Python': 0.06; 'versions,': 0.07; 'mess': 0.09; 'cc:addr:python-list': 0.11; 'question.': 0.14; '(it': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'should.': 0.16; 'followed': 0.16; 'sat,': 0.16; 'wrote:': 0.18; 'cc:addr:python.org': 0.22; 'print': 0.22; 'cc:2**0': 0.24; 'this:': 0.26; 'header:In-Reply-To:1': 0.27; 'chris': 0.29; 'am,': 0.29; 'message-id:@mail.gmail.com': 0.30; 'url:mailman': 0.30; 'asked': 0.31; 'code': 0.31; 'lines': 0.31; 'explained': 0.31; 'thanks!': 0.32; 'url:python': 0.33; "can't": 0.35; 'display': 0.35; 'but': 0.35; 'received:google.com': 0.35; 'google': 0.35; 'done': 0.36; 'url:listinfo': 0.36; 'next': 0.36; 'url:org': 0.36; 'two': 0.37; 'list': 0.37; 'version,': 0.38; 'list,': 0.38; 'mailing': 0.39; 'url:mail': 0.40; 'how': 0.40; 'is.': 0.60; 'break': 0.61; 'first': 0.61; 'here:': 0.62; 'such': 0.63; 'different': 0.65; 'side': 0.67; 'good!': 0.84; 'horrible': 0.84; 'to:none': 0.92 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:cc :content-type; bh=B6yY5XIBt2cK97+m4nsm3Y6W4LDnU1XxExW+Cqm9NKA=; b=v9Kya6OJ2y9OPVjSpk/VU/n8wAlNWAJ7Y9f1YxpzpvKtLfHdrHKZc/IXC7WF5Glbm+ YEwXRQuQO8iWIuLRJIbmz8LY7wbryWL7Z33gtQhXODo4vJ+gHdWcaCuoYkRifDSHYYGe YzLcZWWyt4No59tFsTbp4AECd5JNi8A7CQMJ+RzxUZ+YamQ3gKbLtMOQuya5ck7FnNeK pw/B34asDy7wlwiTdsqc9hma2Fws5iQt8Y/HwZ5MHPPN7cHDhsae02Zl1VsC24ytDe5j 2n9M5Js/ZL6QQ1z7FDSNvhaS+Q2EQV10Sz2H7UKkNR4pVsF4yIyTqv2XMF1myB5YXSqx d17g== MIME-Version: 1.0 X-Received: by 10.42.231.9 with SMTP id jo9mr15270868icb.12.1412359479245; Fri, 03 Oct 2014 11:04:39 -0700 (PDT) In-Reply-To: References: <3c9504c9-6906-4358-b14c-5764bba70a65@googlegroups.com> <2c198e3c-ddee-47a9-b744-a35c726cdfd2@googlegroups.com> Date: Sat, 4 Oct 2014 04:04:39 +1000 Subject: Re: Python Basics From: Chris Angelico Cc: "python-list@python.org" Content-Type: text/plain; charset=UTF-8 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: 39 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1412359482 news.xs4all.nl 2930 [2001:888:2000:d::a6]:44500 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:78658 On Sat, Oct 4, 2014 at 3:54 AM, wrote: > Hi Chris > I can't get the code to display the output as it should. > I can get it to display like this: > 122333444455555 or I can get it to display like this: > 1 > 2 > 2 > 3 > 3 > 3 > 4 > 4 > 4 > 4 > 5 > 5 > 5 > 5 > 5 > but not as has been asked in the question. Good! (It would help if you explained how you had the two different versions, incidentally.) What you need is like the first version, only you want to break the lines every time the digit changes. That can be done pretty easily. All you need to do is print out nothing, followed by end-of-line; and you need to do this in such a way that it happens after all of one digit has been displayed, but before the next one is. Can you do that? Side point: Google Groups makes a horrible mess of your posts. Please consider switching to the mailing list, or to a better newsreader. You can join the mailing list here: https://mail.python.org/mailman/listinfo/python-list Thanks! ChrisA