The odd thing is that the same code runs perfectly in the Mac terminal, but incorrectly in Komodo Edit. In the latter, the input prompts are somehow being included  into the variables themselves somehow due to the way Komodo works.<br>
<br>Thanks for the help. I&#39;ve just taken to running the code in the Mac terminal which is working great.<div><br></div><div>Asif</div><div><br><div class="gmail_quote">On Sun, Mar 25, 2012 at 9:45 AM, Joel Goldstick <span dir="ltr">&lt;<a href="mailto:joel.goldstick@gmail.com">joel.goldstick@gmail.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5">On Sun, Mar 25, 2012 at 1:31 AM, Asif Kazmi &lt;<a href="mailto:akazmi001@gmail.com">akazmi001@gmail.com</a>&gt; wrote:<br>

&gt; Hello,<br>
&gt;<br>
&gt; I&#39;m going through Python Programming for the Absolute Beginner, 3rd edition,<br>
&gt; on a Mac with Python 3.2.<br>
&gt;<br>
&gt; In the second chapter, the book gives sample code that shows how a logical<br>
&gt; error can occur:<br>
&gt;<br>
&gt; # Trust Fund Buddy - Bad<br>
&gt; # Demonstrates a logical error<br>
&gt;<br>
&gt; print(<br>
&gt; &quot;&quot;&quot;<br>
&gt;             Trust Fund Buddy<br>
&gt;<br>
&gt; Totals your monthly spending so that your trust fund doesn&#39;t run out<br>
&gt; (and you&#39;re forced to get a real job).<br>
&gt;<br>
&gt; Please enter the requested, monthly costs.  Since you&#39;re rich, ignore<br>
&gt; pennies<br>
&gt; and use only dollar amounts.<br>
&gt;<br>
&gt; &quot;&quot;&quot;<br>
&gt; )<br>
&gt;<br>
&gt; car = input(&quot;Lamborghini Tune-Ups: &quot;)<br>
&gt; rent = input(&quot;Manhattan Apartment: &quot;)<br>
&gt; jet = input(&quot;Private Jet Rental: &quot;)<br>
&gt; gifts = input(&quot;Gifts: &quot;)<br>
&gt; food = input(&quot;Dining Out: &quot;)<br>
&gt; staff = input(&quot;Staff (butlers, chef, driver, assistant): &quot;)<br>
&gt; guru = input(&quot;Personal Guru and Coach: &quot;)<br>
&gt; games = input(&quot;Computer Games: &quot;)<br>
&gt;<br>
&gt; total = car + rent + jet + gifts + food + staff + guru + games<br>
&gt;<br>
&gt; print(&quot;\nGrand Total:&quot;, total)<br>
&gt;<br>
&gt; input(&quot;\n\nPress the enter key to exit.&quot;)<br>
&gt;<br>
&gt;<br>
&gt; This program should show the inputted numbers as a concatenation rather than<br>
&gt; a sum, I understand that is the mistake in the code. However, when I run it,<br>
&gt; it shows:<br>
&gt;<br>
&gt; Grand Total: 111Manhattan Apartment: 111Private Jet Rental: 111Gifts:<br>
&gt; 111Dining Out: 111Staff (butlers, chef, driver, assistant): 111Personal Guru<br>
&gt; and Coach: 111Computer Games: 111<br>
&gt;<br>
&gt; It appears to be adding the input prompt as part of the variables? except<br>
&gt; for car? What am I missing?<br>
&gt;<br>
&gt; Thanks,<br>
&gt; Asif<br>
&gt;<br>
</div></div>&gt; _______________________________________________<br>
&gt; Tutor maillist  -  <a href="mailto:Tutor@python.org">Tutor@python.org</a><br>
&gt; To unsubscribe or change subscription options:<br>
&gt; <a href="http://mail.python.org/mailman/listinfo/tutor" target="_blank">http://mail.python.org/mailman/listinfo/tutor</a><br>
&gt;<br>
Input returns a string in python 3.  So you are doing something like<br>
&#39;1&#39; + &#39;1&#39; ... etc which will concatinate the strings.  Test it out by<br>
typing in something other than a number for your inputs.<br>
<br>
Once you get that worked out, see what your code produces.<br>
<span class="HOEnZb"><font color="#888888"><br>
<br>
--<br>
Joel Goldstick<br>
</font></span></blockquote></div><br></div>