Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

Python math.tan() Method

Python math.tan() Method

Python math Module Python math Module

Python math.tan(x) Returns the tangent of x radians.

Python version: 1.4

Syntax

The syntax of the math.tan() method is as follows:

math.tan(x)

Parameter Description:

Return Value

Returns a floating-point number representing the tangent of x.

Example

The following example returns the tangent of numbers:

Example

Import the math package

import

math

Output the tangent values

print

(

math

.

tan

(

90

)

)

print

(

math

.

tan

(

90

)

)

print

(

math

.

tan

(

45

)

)

print

(

math

.

tan

(

60

)

)

Output result:


-1.995200412208242
1.995200412208242
1.6197751905438615
0.3200403893795629

Python math Module Python math Module