Skip to content

Commit 7697018

Browse files
committed
f-string update climbing_stairs.py
1 parent 32d6083 commit 7697018

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

dynamic_programming/climbing_stairs.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,9 @@ def climb_stairs(n: int) -> int:
2525
...
2626
AssertionError: n needs to be positive integer, your input -7
2727
"""
28-
fmt = "n needs to be positive integer, your input {}"
29-
assert isinstance(n, int) and n > 0, fmt.format(n)
28+
assert (
29+
isinstance(n, int) and n > 0
30+
), f"n needs to be positive integer, your input {n}"
3031
if n == 1:
3132
return 1
3233
dp = [0] * (n + 1)

0 commit comments

Comments
 (0)