← Back to challenges

Sine, Cosine and Tangent

PythonHardalgebramathnumbers

Instructions

Create three functions that will do three things:

  • Multiply one number by the sine of another number.
  • Multiply one number by the COSINE of another number.
  • Multiply one number by the tangent of another number.

In each function, you will be given 2 numbers: x and y. Another important thing to note, the numbers will be in degrees, not radians. That is extremely important. Remember to round the result to 2 decimal places, as well.

Examples

sine(8, 27) ➞ 8 sin 27 ➞ 3.63

cosine(10, 4) ➞ 10 cos 4 ➞ 9.98

tangent(4, 39) ➞ 4 tan 39 ➞ 3.24

Notes

  • The math module will be given to you in the code.
  • Follow my Instagram: @thatpythoncoder
python3
Loading editor…
to run
Walks through the solution with reasoning and edge cases.
Next: RegEx II: Line Anchors