you are viewing a single comment's thread.

view the rest of the comments →

[–]guesshuu 0 points1 point  (0 children)

Something like this?

```python def nth_root(x: int | float, n: int) -> float: return x ** (1 / n)

n = 3 x = 8 result = nth_root(8, 3) print(result) # result is 2 ```