Advertisement
ALEXANDAR_GEORGIEV

rhombus_stars_2

Jun 9th, 2022
53
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.35 KB | None | 0 0
  1. count_stars = int(input())
  2. number_spaces = count_stars
  3. space_step = -1
  4. number_stars = 1
  5. stars_step = 1
  6. for row in range(1, 2 * count_stars):
  7.     print(" " * (number_spaces - 1) + "*" * (2 * number_stars - 1))
  8.     if row == count_stars:
  9.         space_step = 1
  10.         stars_step = -1
  11.     number_spaces += space_step
  12.     number_stars += stars_step
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement