<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">On Sun, Dec 30, 2012 at 5:37 PM, Alvaro Lacerda <span dir="ltr"><<a href="mailto:alacerda617@gmail.com" target="_blank">alacerda617@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">The code I wrote is supposed to ask the user to enter a number;<br>
Then tell the user what's going to happen to that number (x / 2 + 5) ;<br>
Then give the user an answer;<br></blockquote><div><br></div><div>Try x / 2.5 + 5 <br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
I succeeded getting results from even numbers, but when I try diving an uneven number (i.e. 5) by 2, I get only the whole number (i.e. 2)<br>
<br>
I'm trying to get full number result using the %d command, I've tried to add the line "from __future__ import division" to the beginning of my code, but I haven't been succeeded.<br>
<br>
I also tried making my numbers decimals (i.e. 2.0 instead of just 2)<br>
<br>
<br>
Below is my program and thanks for the help :)<br>
<br>
<br>
<br>
from __future__ import division;<br>
<br>
def decimal_percent_test():<br>
    number = input("Enter a number: ");<br>
    print number, "will be divided by 2 then added by 5!";<br>
    print " %d divided by %d is %d plus %d is... %d !" %(number,2,number/2,5,number/2+5);<br>
<span class="HOEnZb"><font color="#888888"><br>
<br>
<br>
<br>
--<br>
<a href="http://mail.python.org/mailman/listinfo/python-list" target="_blank">http://mail.python.org/mailman/listinfo/python-list</a><br>
</font></span></blockquote></div><br><br clear="all"><br>-- <br>Joel Goldstick<br>
</div></div>