3 ms·
Ah, that's a missing link I hadn't thought of. This was a result of converting degrees to radians. There is another way as well. from math import sin, aco
by ksaj 2y ago
Ah, that's a missing link I hadn't thought of.
This was a result of converting degrees to radians. There is another way as well.
from math import sin, acos
def nines(repeat: int) -> float:
repeated = 2 / int('9' * repeat)
value = sin(repeated) * acos(repeated) * (10 ** repeat)
return value
nines(18)
I'm sure this can be edited to accept other values in the same way.
Took a while to convince me, but you got there.
- valicord 2y agoHint: it works just as well if you replace the acos argument with 0 value = sin(repeated) * acos(0) * (10 ** repeat) (keep in mind that that acos(0) = pi/2)