length = int(input("Enter a length: ")) width = int(input("Enter a width: ")) filled = input("Filled (y/n): ") if filled == "n": print(" + " * length) for _ in range(width - 2): print(" + " + " " * (length - 2) + " + ") if width > 1: print(" + " * length) else: for _ in range(width): print(" + " * length)