YankoGrancharov

diamond

Jun 28th, 2017
154
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.73 KB | None | 0 0
  1. n = int(input())
  2. tire = (n-1)//2
  3. tire2 = 1
  4. if n == 1:
  5.     print("*")
  6. elif n == 2:
  7.     print("*")
  8. else:
  9.     for i in range ((n-1)//2+1):
  10.         print("-" * tire, end = "")
  11.         print("*", end = "")
  12.         sreda = (n-(tire*2)-2)
  13.         if sreda >=0:
  14.             print("-"*sreda, end = "")
  15.             print("*",end = "")
  16.         print("-" * tire, end="")
  17.         print()
  18.         tire = tire-1
  19.     for i in range ((n-1)//2):
  20.         print("-"*(tire2),end = "")
  21.         print("*",end = "")
  22.         sreda2 = n-((tire2)*2+2)
  23.         if sreda2>= 0:
  24.             print("-"*sreda2,end = "")
  25.             print("*",end = "")
  26.         print("-" * (tire2), end="")
  27.         print()
  28.         sreda2 = sreda2 -1
  29.         tire2 = tire2+1
Advertisement
Add Comment
Please, Sign In to add comment