width = int(input("Enter a number: ")) to_width = 0 while to_width < width: to_width += 1 print("* " * to_width) while to_width > 0: to_width -= 1 print("* " * to_width)