Python‎ > ‎math‎ > ‎

math.tan()


Definition
Python will return the value of tan().

Syntax
math.tan(x)

Parameters
x=numbers

Example 1
 >>> import math
>>> math.tan(1)
1.5574077246549023
>>> math.tan(0)
0.0

Example 2
The input() is used to get the value of math.tan(x).
import math
x=int(input("Please enter your Tangent numeric value: "))
print ("Your Tangent value is: ", math.tan(x))
>>> 
Please enter your Tangent numeric value: 22>>>
Please enter your Sine numeric value: 22
Your Sine value is: -0.008851309290403876
>>>

operator.itruediv
The operator.itruediv(a,b) returns with:
 >>> import operator
>>> import math
>>> operator.itruediv(math.tan(1), math.sin(1))
1.8508157176809257


round(math.tan())/round(math.sin())
The method is rounded to let the operator get the value because operator does not support float.
>>> import operator
>>> import math
>>> a=round(math.tan(1))

>>> b=round(math.sin(1))
>>> operator.ixor(a,b)
3
>>>

sum(map())
The function returns with the sum of three tuple.
import math
x=(math.acos(1),math.asin(1),math.atan(1))
y=(math.sin(-1),math.cos(-1),math.tan(-1))
z=(math.cosh(.1),math.sinh(.1),math.tanh(.1))
print("The sum is", sum(map(lambda a,b,c: a+b+c, x,y,z)))
>>>
The sum is 1.7024569992982896
>>>


Comments