width = int(input("Enter a width: ")) height = int(input("Enter a height: ")) filled = input('Filled (y/n)') if filled == ("y"): for i in range(height): for i in range(width): print("+ ", end="") print() elif filled == ("n"): for i in range(height): for i in range(width): if i == 0 or i == height - 1 or i == 0 or i == width - 1: print("+ ", end="") else: print(" ", end="") print()