<br><br><div class="gmail_quote">2011/6/13 amt <span dir="ltr"><<a href="mailto:0101amt@gmail.com">0101amt@gmail.com</a>></span><br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
I came up with: <br>print "Roosters", 100 - float(25) * 3 % 4 <br><br>This is for line 3 so it is more precised. Is it correct what I did? </blockquote><div><br>I don't think so. All the operations in this line are for integers. % means the remainder of the division, so according to the precedence, the original may be parenthesed as 100-(25*3%4), which is really 97 (75 divided by 4 is 18, and 3 remains).<br>
</div><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">What do I have to do for line 5?<br></blockquote><br>Hard to say without you share your Python version with us. Division behaves differently in P2.x and P3.x<br>
<br>Also note that besides float() there is a more simple way to make a float from an integer: write 1.0 instead of 1, and it becomes a float as well as the result of the operation. Using the function is good if you work with a variable.<br>
</div><br>