Path: csiph.com!usenet.pasdenom.info!aioe.org!news.stack.nl!newsfeed.xs4all.nl!newsfeed2.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.004 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'from:addr:yahoo.co.uk': 0.04; 'subject:help': 0.08; 'string': 0.09; 'lawrence': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'spaces': 0.09; 'tismer': 0.09; 'python': 0.11; '"."': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'subject:beginner': 0.16; 'subject:class': 0.16; 'subject:programming': 0.16; 'subject:python': 0.16; 'sat,': 0.16; 'language': 0.16; 'wrote:': 0.18; '>>>': 0.22; 'programming': 0.22; 'print': 0.22; 'header:User-Agent:1': 0.23; 'sorry,': 0.24; 'this:': 0.26; 'second': 0.26; 'least': 0.26; 'header:X -Complaints-To:1': 0.27; 'header:In-Reply-To:1': 0.27; 'fri,': 0.33; 'subject: (': 0.35; 'subject:with': 0.35; 'convert': 0.35; 'but': 0.35; '+0100': 0.36; 'thanks': 0.36; 'wrong': 0.37; 'christian': 0.38; 'nov': 0.38; 'to:addr:python-list': 0.38; 'does': 0.39; 'to:addr:python.org': 0.39; 'received:org': 0.40; 'even': 0.60; 'number,': 0.60; 'world.': 0.61; 'kindly': 0.61; 'email addr:gmail.com': 0.63; 'name': 0.63; 'subject:Need': 0.64; 'total': 0.65; 'below:': 0.68; 'received:2': 0.84; 'wrong!': 0.84; 'was:': 0.91; '2013': 0.98 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Mark Lawrence Subject: Re: Need help with programming in python for class (beginner level) Date: Sat, 30 Nov 2013 00:59:16 +0000 References: <20131130013836.49f68d62@hanez.org> <20131130014903.220759fa@hanez.org> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Gmane-NNTP-Posting-Host: host-2-98-202-28.as13285.net User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:24.0) Gecko/20100101 Thunderbird/24.1.1 In-Reply-To: <20131130014903.220759fa@hanez.org> 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: 36 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1385773176 news.xs4all.nl 15987 [2001:888:2000:d::a6]:60639 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:60785 On 30/11/2013 00:49, Johannes Findeisen wrote: > On Sat, 30 Nov 2013 01:38:36 +0100 > Johannes Findeisen wrote: > >> On Fri, 29 Nov 2013 16:31:21 -0800 (PST) >> farhanken@gmail.com wrote: >> >>> print "

The total rolled was: "number"

" >> >> The above line is wrong. You did it right below: >> >>> print "

Thanks for playing, " + name + ".

" >>> print "

You bet the total would be at least " + value + ".

" >> >> Do this: >> >> print "

The total rolled was: " + number + "

" > > Sorry, that was wrong! You need to convert to a string when > concatenating... > > print "

The total rolled was: " + str(number) + "

" > Wrong again, or at least overengineered. print "

The total rolled was:", number,

" You don't even need the spaces as print kindly does it for you :) -- Python is the second best programming language in the world. But the best has yet to be invented. Christian Tismer Mark Lawrence