To take the sine of a number in python, you can use the math module which provides access to mathematical functions including sine(). The input to sine() should be in radians, not degrees.
Here is an example code block that takes the sine of a number:
main.py225 chars11 lines
In this example, we first convert the angle from degrees to radians using math.radians(). Then we use math.sin() to calculate the sine of the angle in radians. Finally, we print the result.
gistlibby LogSnag