Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- n = int(input())
- for i in range(n + n % 2 - 1):
- x = i if i < n // 2 + n % 2 else x - 1
- out_dashes = '-' * ((n - 1) // 2 - x)
- in_dashes = '-' * (x * 2 - (n % 2))
- print(f"{out_dashes}*{in_dashes}{'' if n % 2 == 1 and x == 0 else '*'}{out_dashes}")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement