Advertisement
pacho_the_python

arrow

Apr 3rd, 2022
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.91 KB | None | 0 0
  1. n = int(input())
  2.  
  3. high = n - 2
  4. length = 2 * n - 1
  5. points_out = int((n - 1) / 2)
  6. inner_points = n - 2
  7.  
  8. print("." * points_out + "#" * n + "." * points_out)
  9.  
  10. for i in range(1, high + 1):
  11.     for j in range(1, length + 1):
  12.         print("." * points_out + "#" + "." * inner_points + "#" + "." * points_out)
  13.         break
  14.  
  15. print("#" * points_out + "#" + "." * inner_points + "#" + "#" * points_out)
  16.  
  17. second_high = n - 2
  18. arrow_points_out = 2
  19. points_left_right = int(arrow_points_out / 2)
  20. arrow_points_in = length - 4
  21.  
  22. for x in range(1, second_high + 1):
  23.     for y in range(1, length + 1):
  24.         print("." * points_left_right + "#" + "." * arrow_points_in + "#" + "." * points_left_right)
  25.         arrow_points_out += 2
  26.         arrow_points_in -= 2
  27.         points_left_right = int(arrow_points_out / 2)
  28.         break
  29.  
  30. final_points = int((length - 1) / 2)
  31. print("." * final_points + "#" + "." * final_points)
  32.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement