Skip to content

Commit

Permalink
Update butterfly_pattern.py
Browse files Browse the repository at this point in the history
  • Loading branch information
MaximSmolskiy authored Jan 14, 2025
1 parent 391e664 commit 186806c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions graphics/butterfly_pattern.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@ def butterfly_pattern(n: int) -> str:
# Upper part
for i in range(1, n + 1):
left_stars = "*" * i
spaces = " " * (2 * (n - i))
spaces = " " * (2 * (n - i) - 1)
right_stars = "*" * i
result.append(left_stars + spaces + right_stars)

# Lower part
for i in range(n - 1, 0, -1):
left_stars = "*" * i
spaces = " " * (2 * (n - i))
spaces = " " * (2 * (n - i) - 1)
right_stars = "*" * i
result.append(left_stars + spaces + right_stars)

Expand Down

0 comments on commit 186806c

Please sign in to comment.