Skip to content

Instantly share code, notes, and snippets.

@computer-tutor
Created April 28, 2020 05:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save computer-tutor/037e5211f95aa255262d6158400b9b10 to your computer and use it in GitHub Desktop.
Save computer-tutor/037e5211f95aa255262d6158400b9b10 to your computer and use it in GitHub Desktop.
def nthroot(x,n=2):
return round(x**(1/n),2)
print("Nth root of",10, 'for n=3 is',nthroot(10,3))
print("Square root of",30,"is", nthroot(30))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment