Advertisement
pacho_the_python

Butterfly

Apr 3rd, 2022
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.85 KB | None | 0 0
  1. n = int(input())
  2.  
  3. high = n - 2
  4. length = 2 * n - 1
  5. stars = int((length - 3) / 2)
  6. dash = int((length - 3) / 2)
  7. for i in range(1, high + 1):
  8.     if i % 2 != 0:
  9.         print("*" * stars, end="")
  10.         print("\\", end="")
  11.         print(" ", end="")
  12.         print("/", end="")
  13.         print("*" * stars)
  14.     else:
  15.         print("-" * dash, end="")
  16.         print("\\", end="")
  17.         print(" ", end="")
  18.         print("/", end="")
  19.         print("-" * dash)
  20.  
  21.  
  22. print(" " * (n - 1) + "@")
  23.  
  24. for i in range(1, high + 1):
  25.     if i % 2 != 0:
  26.         print("*" * stars, end="")
  27.         print("/", end="")
  28.         print(" ", end="")
  29.         print(chr(92), end="")
  30.         print("*" * stars)
  31.     else:
  32.         print("-" * dash, end="")
  33.         print("/", end="")
  34.         print(" ", end="")
  35.         print(chr(92), end="")
  36.         print("-" * dash)
  37.  
  38.  
  39.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement