width = int(input("Enter a width: ")) height = int(input("Enter a height: ")) filled = input("Filled (y/n): ").lower() == 'y' print("Here is your box:") for h in range(height): if filled or h == 0 or h == height - 1: print("+ " * width) else: print("+ " + " " * (width - 2) + "+")