Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!news.stack.nl!newsfeed.xs4all.nl!newsfeed1.news.xs4all.nl!xs4all!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.006 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'received:internal': 0.09; 'better:': 0.16; 'message-id:@webmail.messagingengine.com': 0.16; 'received:10.202': 0.16; 'received:10.202.2': 0.16; 'received:10.202.2.44': 0.16; 'received:66.111': 0.16; 'received:66.111.4': 0.16; 'received:66.111.4.27': 0.16; 'received:compute4.internal': 0.16; 'received:messagingengine.com': 0.16; 'received:out3-smtp.messagingengine.com': 0.16; 'wayne': 0.16; 'sat,': 0.16; 'wrote:': 0.18; 'wed,': 0.18; 'meant': 0.20; 'aug': 0.22; 'define': 0.26; 'header:In-Reply-To:1': 0.27; 'am,': 0.29; "skip:' 10": 0.31; 'sep': 0.31; 'received:66': 0.35; 'something': 0.35; 'skip:- 20': 0.37; 'received:10': 0.37; 'to:addr:python- list': 0.38; 'to:addr:python.org': 0.39; 'header:Message-Id:1': 0.63; 'subject:space': 0.84; '2013,': 0.91 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=letterboxes.org; h=message-id:from:to:mime-version:content-transfer-encoding :content-type:in-reply-to:references:subject:date; s=mesmtp; bh= knHqGURtNYhf3rdxND74NuQyoHc=; b=dqQA71tGi6cO5nv7QQTaRXTf45qMPRrM QLPxrM4N5Xzk4s68LB6UD9glSDCvMlE2i2t1iK6yW5dPb8+KF5bGQwXUwK9BJyln lK5mJ9TwwC6Gy+emUfoc0RmN/fm9rXNUcYqyW2ZWYUDeqhWyukWm9nD/XO0k27hY Kaeeu1qZkjY= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=message-id:from:to:mime-version :content-transfer-encoding:content-type:in-reply-to:references :subject:date; s=smtpout; bh=knHqGURtNYhf3rdxND74NuQyoHc=; b=TH/ 9cLryOlvXSx73BA9ohfKGaB7KsZ0FrXu5eISVtCA8nlGGu/8/70XF/q4NZ5Q7ZMe Z09PSGps7eyVVnDpc27trErG0hgcCIdVdLNxNsAC51YZkuUnZuCY9590kwvqqOY/ JcXR1l1S8JeW2lkuyENt+4ugHN+UIyDqCurrTVDA= X-Sasl-Enc: NfObdJPO3WKt05h7WgfQgbIS5a9VR4CRtYw3T4GdEEte 1379013930 From: Albert Hopkins To: python-list@python.org MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain X-Mailer: MessagingEngine.com Webmail Interface - ajax-d310b333 In-Reply-To: References: <5221a693$0$2059$426a74cc@news.free.fr> Subject: Re: print function and unwanted trailing space Date: Thu, 12 Sep 2013 15:25:30 -0400 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: 21 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1379013943 news.xs4all.nl 16008 [2001:888:2000:d::a6]:44574 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:54081 On Wed, Sep 11, 2013, at 07:36 AM, Wayne Werner wrote: > On Sat, 31 Aug 2013, candide wrote: > > # ----------------------------- > > for i in range(5): > > print(i, end=' ') # <- The last ' ' is unwanted > > print() > > # ----------------------------- > > Then why not define end='' instead? I think the OP meant that ' ' is wanted up until the final item.. so something like for i in range(4): print(i, end=' ') print(4) or, better: print(' '.join(str(i) for i in range(5)))