Python 循环反转钻石

Python Loop Reverse Diamond

我有一个循环创建钻石的代码,但我希望它被反转。

width = int(input("Please enter a width: "))

i = 1
while i < width*2:
    if i < width:
        print("-" * (width-i) + " *" * i + "-" * (width-i))
    else:
        print("-" * (i-width) + " *" * (2*width-i) + "-" * (i-width))
    i += 1 [EDIT: formatting mistake]

我的输出如下:

---- *----
--- * *---
-- * * *--
- * * * *-
 * * * * *
- * * * *-
-- * * *--
--- * *---
---- *----

但我希望它是这样的:

 * * * * *
- * * * *-
-- * * *--
--- * *---
---- *----
---- *----
--- * *---
-- * * *--
- * * * *-
 * * * * *

不胜感激!

width = int(input("Please enter a width: "))

i = 0
while i < width*2:
    if i < width:
        print("-" * i+ " *" * (width-i) + "-" * i)
    else:
        print("-" * ((2*width-i) -1) + " *" * (i - width + 1) + "-" *     ((2*width-i) -1))
    i += 1