Skip to content

Commit 391e664

Browse files
Update butterfly_pattern.py
1 parent ad7f054 commit 391e664

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

graphics/butterfly_pattern.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,14 @@ def butterfly_pattern(n: int) -> str:
1414
# Upper part
1515
for i in range(1, n + 1):
1616
left_stars = "*" * i
17-
spaces = " " * (2 * (n - i + 2))
17+
spaces = " " * (2 * (n - i))
1818
right_stars = "*" * i
1919
result.append(left_stars + spaces + right_stars)
2020

2121
# Lower part
2222
for i in range(n - 1, 0, -1):
2323
left_stars = "*" * i
24-
spaces = " " * (2 * (n - i + 2))
24+
spaces = " " * (2 * (n - i))
2525
right_stars = "*" * i
2626
result.append(left_stars + spaces + right_stars)
2727

0 commit comments

Comments
 (0)