0
import math problem đ€
We know tan 45° = 1 But in python, 1. why tan 45° = 0.999....? 2. How can I fix it? Sample input: tan 45° Expected output: 1 Sample input: tan 225° Expected Output: 1
2 Answers
+ 2
#I found a solution:
from math import *
x = tan(radians(45))
if str(0.999999) in str(x):
x = round(x)
print (x)