Python Practice › NumPy Programs › Program 95
Tangent of angles
Write a NumPy program to calculate the tangent of angles.
Input
0, 45 degrees
Output
[0. 1.]
Approach
np.tan(np.radians(...)).
Solution
import numpy as npprint(np.tan(np.radians([0, 45])).round(3))Output
[0. 1.]
Learn the concept
New to this topic? Read the lesson, then come back.