py4e icon indicating copy to clipboard operation
py4e copied to clipboard

Line 7 in py4e/code3/pay3.py and py4e/code/pay3.py

Open solomon-s-b opened this issue 5 years ago • 2 comments

Exercise 2 in chapter 3 line 7 should be:

pay = hours * rate + (hours - 40) * rate * 0.5

instead of:

pay = hours * rate + (hours - 40) * rate * 1.5

as it is in py4e/code3/pay2.py and py4e/code/pay2.py on line 6.

solomon-s-b avatar Aug 13 '20 14:08 solomon-s-b

In my opinion lines 6 and 7 should be:

if hours > 40: pay = 40 * rate + (hours - 40) * rate * 1.5

instead of if hours > 40: pay = hours* rate + (hours - 40) * rate * 1.5

MariusWaldvogel avatar Aug 05 '21 14:08 MariusWaldvogel

if you appy the distributive property (if I'm saying it right) you'll see that you are saying the same :)

konkiourtidou avatar Aug 24 '21 20:08 konkiourtidou