An exercise of creating a series of repeating and alternating vertical and horizontal lines in an equally…