Write three small functions that a calculator would need: one takes away whole turns, one finds the quadrant, and one lists the functions that are positive.
The idea. x % (2 * math.pi) takes away whole turns. Dividing what is left by and keeping the whole part gives , , or .
Your tasks.
reduce, return the angle with whole turns taken away, from up to .quadrant, return , , or .positive, return the names among "sin", "cos" and "tan" whose value is positive at x, in that order.Have you tried it?
Do the tasks in the editor first, and run the checker after each one. Its hints help when a check fails. When you are ready, compare your code with this solution.
Log in to join the discussion.
Loading…