3 ms·
Any number works if you adjust the multiplier to preserve the 1000.../555... = 1.8 property. For example: https://www.online-python.com/Um4qevAzo2 https://www.o
by valicord 2y ago
Any number works if you adjust the multiplier to preserve the 1000.../555... = 1.8 property. For example: https://www.online-python.com/Um4qevAzo2 https://www.online-python.com/Um4qevAzo2
- ksaj 2y agoAh, 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)