Python includes two functions in the math
package; radians
converts degrees to radians, and degrees
converts radians to degrees.
To match the output of your calculator you need:
>>> math.cos(math.radians(1))
0.9998476951563913
Note that all of the trig functions convert between an angle and the ratio of two sides of a triangle. cos, sin, and tan take an angle in radians as input and return the ratio; acos, asin, and atan take a ratio as input and return an angle in radians. You only convert the angles, never the ratios.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…