math.cos(x) not returning correct value?
问题 I just started using python, and am having difficulty with a very basic program. I want to calculate the cosine of -20 degrees. It is my understanding that the default value is in radians, so this is the following code i tried: import math print math.cos(math.degrees(-20)) This outputs (-.7208...), where the answer is actually (.9397...). I'm sure this has a pretty basic solution but I've tried so many different things and it will not output the correct results. Thanks in advance! 回答1: Per