Skip to content

Commit d35b3a6

Browse files
authored
fix perfect_cube.py
1 parent 203d358 commit d35b3a6

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

maths/perfect_cube.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,8 @@ def perfect_cube(n: int) -> bool:
2525
False
2626
"""
2727
# Handle negative numbers
28-
if n < 0:
28+
if is_negative := n < 0:
2929
n = -n
30-
is_negative = True
31-
else:
32-
is_negative = False
33-
3430
val = n ** (1 / 3)
3531
# Round to avoid floating point precision issues
3632
rounded_val = round(val)

0 commit comments

Comments
 (0)