Fix: Ensure all skills are tracked as files, not submodules
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
def iscube(a):
|
||||
'''
|
||||
Write a function that takes an integer a and returns True
|
||||
if this ingeger is a cube of some integer number.
|
||||
Note: you may assume the input is always valid.
|
||||
Examples:
|
||||
iscube(1) ==> True
|
||||
iscube(2) ==> False
|
||||
iscube(-1) ==> True
|
||||
iscube(64) ==> True
|
||||
iscube(0) ==> True
|
||||
iscube(180) ==> False
|
||||
'''
|
||||
if a == 0:
|
||||
return True
|
||||
cube_root = round(abs(a) ** (1/3))
|
||||
return cube_root ** 3 == abs(a)
|
||||
Reference in New Issue
Block a user