Home >>Python math Module >Python math.cos() Method
Python math.cos() Method in python is used to returns the cosine of the given number radians and it accepts a number.
Syntax:math.cos(x)
Parameter | Description |
---|---|
x | It is required a number to find the cosine, and it returns a TypeError |
import math
print (math.cos(0.02))
print (math.cos(-1.67))
print (math.cos(4))
print (math.cos(6.873435))
import math
x = -4
print("cos(",x,") is = ", math.cos(x))
x = 2
print("cos(",x,") is = ", math.cos(x))
x = -1.562
print("cos(",x,") is = ", math.cos(x))
x = -2
print("cos(",x,") is = ", math.cos(x))