Feb-21-2019, 04:42 PM
(Feb-21-2019, 04:36 PM)Carson147 Wrote: However when I tested some values they come close but doesn't match my phone's calculator, I'm not sure what went wrong.please provide sample input, output and presumably correct output from your phone
Actually I see the problem
on line 7 you convert the user input to degrees (but it is already in degrees). You need to convert the user input to radians
from math import sin from math import degrees from math import radians user_input = input('Enter an angle in degrees >') degs = int(user_input) rads = radians(degs) answer = sin(rads) print('The sin of {} degrees is {}'.format(degs, answer))
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs