height = int(input("Enter a height:")) width = int(input("Enter a width:")) fill = input("Do you want the square to be filled? y n:") if fill == "y" : for number in range(height): print("+" * width) if fill == "n" : print("+ "*width) for number in range(height-3): print("+", " "*(((width-1)+(width-2))-2), "+") print("+ "*width)