Advertisement
Spocoman

Sublime Logo

Sep 24th, 2023
794
1
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.86 KB | None | 1 0
  1. n = int(input())
  2.  
  3. stars = 2
  4. spaces = 2 * n - 2
  5.  
  6. for row in range(n):
  7.     print(' ' * spaces + '*' * stars)
  8.     spaces -= 2
  9.     stars += 2
  10.  
  11. spaces = 2
  12. stars = 2 * n - 2
  13.  
  14. for row in range(2):
  15.     print('*' * stars + ' ' * spaces)
  16.     spaces += 2
  17.     stars -= 2
  18.  
  19. spaces = 2
  20. stars = 2 * n - 2
  21.  
  22. for row in range(2):
  23.     print('*' * stars + ' ' * spaces)
  24.     if spaces > 0 and stars > 0:
  25.         spaces -= 2
  26.         stars += 2
  27.  
  28. spaces = 2
  29. stars = 2 * n - 2
  30.  
  31. for row in range(2):
  32.     print(' ' * spaces + '*' * stars)
  33.     spaces += 2
  34.     stars -= 2
  35.  
  36. spaces = 2
  37. stars = 2 * n - 2
  38.  
  39. for row in range(2):
  40.     print(' ' * spaces + '*' * stars)
  41.     if spaces > 0 and stars > 0:
  42.         spaces -= 2
  43.         stars += 2
  44.  
  45. spaces = 2
  46. stars = 2 * n - 2
  47.  
  48. for row in range(n):
  49.     print('*' * stars + ' ' * spaces)
  50.     spaces += 2
  51.     stars -= 2
  52.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement