Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- n = int(input())
- e = n % 2 == 0
- nn = n - 1 if e else n
- m = (nn + 1) / 2
- for i in range(1, nn + 1):
- d = int(abs(m - i))
- print(
- '-' * d +
- '*' +
- '-' * ((nn + 1) - 2 - 2 * d - (0 if e else 1)) +
- ("" if ((2 * d + 1 == nn) and not e) else "*") +
- '-' * d)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement