yes<br>you can also try:<br>>>> float(a)/b<br>0.33333333333333331<br><br><br><div class="gmail_quote">On Thu, Mar 4, 2010 at 5:15 AM, Wells <span dir="ltr"><<a href="mailto:thewellsoliver@gmail.com">thewellsoliver@gmail.com</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">This seems sort of odd to me:<br>
<br>
>>> a = 1<br>
>>> a += 1.202<br>
>>> a<br>
2.202<br>
<br>
Indicates that 'a' was an int that was implicitly casted to a float.<br>
But:<br>
<br>
>>> a = 1<br>
>>> b = 3<br>
>>> a / b<br>
0<br>
<br>
This does not implicitly do the casting, it treats 'a' and 'b' as<br>
integers, and the result as well. Changing 'b' to 3.0 will yield a<br>
float as a result (0.33333333333333331)<br>
<br>
Is there some way to explain the consistency here? Does python<br>
implicitly change the casting when you add variables of a different<br>
numeric type?<br>
<br>
Anyway, just  curiosity more than anything else. Thanks!<br>
<font color="#888888">--<br>
<a href="http://mail.python.org/mailman/listinfo/python-list" target="_blank">http://mail.python.org/mailman/listinfo/python-list</a><br>
</font></blockquote></div><br>