Solution Review: Calculate Sine, Cosine and Tangent of User Input

This lesson will explain how to use the built-in sin, cosine, and tangent function by importing the math module.

Solution: Import the Built-In Math Module

  • Import the math library using import math

  • Use the built-in function math.sin(x) ,math.cos(x),math.tan(x) function to calculate sin,cos, and tangent of variable x

The following python code demonstrates how to find the sine, cosine and tangent of a number using the built-in math module:

Get hands-on with 1200+ tech skills courses.