<div class="gmail_quote">On Thu, Nov 17, 2011 at 4:32 PM, ADRIAN KELLY <span dir="ltr">&lt;<a href="mailto:kellyadrian@hotmail.com">kellyadrian@hotmail.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><div dir="ltr">
<br><font face="Tahoma" size="2">thanks very much, great response really really appreciated it and now i understand. i hate to ask again but can you see why it won&#39;t print the  &#39;enter and amount over 50&#39; in the right place??</font><div>

<font face="Tahoma" size="2"></font></div></div></div></blockquote><div><br></div><div>Computers are unfailingly stupid machines. They will do whatever wrong thing you tell them to do every single time.</div><div> </div>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div><div dir="ltr"><div><font face="Tahoma" size="2"> </font><font size="2">&lt;snip&gt;</font><div class="im"><div>def main():</div></div><div>    amount=0</div><div>    while amount&lt;50:</div><div class="im"><div>        amount = input(&#39;how much do you want to change:&#39;)</div>

</div><div>        print &#39;enter an amount over €50: &#39;</div><div class="im"><div>    else:</div><div>        total=exchange(amount)</div><div>        print &#39;Your exchange comes to: &#39;,total</div></div></div>

</div></div></blockquote><div><br></div><div>Sometimes it helps writing out the logic in steps before you translate it to code. In this case my guess is that these are the steps you want:</div><div><br></div><div>  1. Get a value from the user (you&#39;re still using input - stop that, it&#39;s dangerous! input is   only a good function in 3.x where it replaces raw_input)</div>

<div> </div><div>  2. If the value is less than 50, tell the user to enter an amount &gt; 50 and repeat step 1</div><div><br></div><div>  3. Otherwise, exchange the amount and display that.</div><div><br></div><div>Right now, these are the steps that you&#39;re doing:</div>

<div><br></div><div>  1. Get a value from the user</div><div><br></div><div>  2. Display the error message</div><div><br></div><div>  3. If the value is &lt; 50, go to 1</div><div><br></div><div>  4. exchange the amount</div>

<div><br></div><div>  5. display the amount.</div><div><br></div><div>HTH,</div><div>Wayne</div></div>