Skip to content

Instantly share code, notes, and snippets.

@angeloped
Created December 2, 2020 06:20
Show Gist options
  • Save angeloped/d7a7ed81b36828fcb8730a8256f4911d to your computer and use it in GitHub Desktop.
Save angeloped/d7a7ed81b36828fcb8730a8256f4911d to your computer and use it in GitHub Desktop.
Determine if the number is perfect cube.
def is_cube(n):
return (n**(1.0/3))%1==0
print(is_cube(28))
print(is_cube(27))
print(is_cube(10))
print(is_cube(8))
print(is_cube(3))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment