Hello, I am a python beginner currently learning from &quot;Learn python the hard way&quot;. I&#39;m stuck at exercise 3 and I would like if it&#39;s possible to get some help so I can move on.<br>Here is the source code:<br>
<br>1 print &quot;I will now count my chickens:&quot; <br>2 print &quot;Hens&quot;, 25 + 30 /6 <br>3 print &quot;Roosters&quot;, 100 - 25 * 3 % 4 #Output is 97<br>4 print &quot;Now I will count the eggs:&quot; <br>5 print 3 + 2 + 1 - 5 + 4 % 2 - 1 / 4 + 6 #Output needs to be 6,83 but Python give me 7<br>
6 print &quot;Is it true that 3 + 2 &lt; 5 - 7? &quot; <br>7 print 3 + 2 &lt; 5 - 7 <br>8 print &quot;What is 3 + 2?&quot;, 3 + 2  <br>9 print &quot;What is 5 - 7?&quot;, 5-7 <br>10 print &quot;Oh, that&#39;s why it&#39;s False.&quot;<br>
11 print &quot;How about some more. &quot; <br>12 print &quot;Is it greater?&quot;, 5 &gt; -2 <br>13 print &quot;Is it greater or equal?&quot;, 5 &gt;= -2 <br>14 print &quot;Is it less or equal?&quot;, 5 &lt;= -2  <br><br>
The author says &quot; Notice the math seems “wrong”? There are no fractions, only whole numbers. Find out why by researching what a “floating point” number is.&quot; <br>I have to rewrite it to use floating point numbers so it&#39;s more accurate. I have read the lines of code and only line 3 and 5 needs to be changed. <br>
<br>I came up with: <br>print &quot;Roosters&quot;, 100 - float(25) * 3 % 4 <br><br>This is for line 3 so it is more precised. Is it correct what I did? What do I have to do for line 5?<br><br><br><br><br><br><br><br>Thanks in advance!<br>
<br><br>Regards, <br>amt.<br>