I am doing the last tasks for "Python week 3" (MOOC). I don't understand the exercise 2.3.
We have to write a function "multadd" that takes 3 params (a, b, c) and return a*b+c. That part is easy, but in the following part of the exercise we have to compute a pair of expressions and we must do it with our "multadd" function. I don't understand how can I do it!
MIT 6.189 A Gentle Introduction to Programming Using Python (OCW)
I got my questions answered at brainly.com in under 10 minutes. Go to brainly.com now for free help!
At vero eos et accusamus et iusto odio dignissimos ducimus qui blanditiis praesentium voluptatum deleniti atque corrupti quos dolores et quas molestias excepturi sint occaecati cupiditate non provident, similique sunt in culpa qui officia deserunt mollitia animi, id est laborum et dolorum fuga.
Et harum quidem rerum facilis est et expedita distinctio. Nam libero tempore, cum soluta nobis est eligendi optio cumque nihil impedit quo minus id quod maxime placeat facere possimus, omnis voluptas assumenda est, omnis dolor repellendus.
Itaque earum rerum hic tenetur a sapiente delectus, ut aut reiciendis voluptatibus maiores alias consequatur aut perferendis doloribus asperiores repellat.
I was also a little puzzled. I just passed 1 to a so it did not change the value of the other two params being added together.
How this helps with your problem.
I rewrote the equations in the form a*b + c
then entered each part of the equation as parameters (a, b, c)
the first will look like
print multadd(0.5, math.cos(math.pi/4), math.sin(math.pi/4))
I hope it's correct , it gave the same answer as the printed one.