I'm having a little problem, take a look:
>>> import math
1.2246467991473532e-16 is close to 0 -- there are 16 zeroes between the decimal point and the first significant digit -- much as
3.1415926535897931 (the value of
math.pi) is close to pi. The answer is correct to sixteen decimal places!
So if you want
sin(pi) to equal 0, simply round it to a reasonable number of decimal places. 15 looks good to me and should be plenty for any application:
print round(math.sin(math.pi), 15)