diff --git a/doormat design hackerrank b/doormat design hackerrank new file mode 100644 index 0000000..2b7abdd --- /dev/null +++ b/doormat design hackerrank @@ -0,0 +1,19 @@ +def doormatDesign(rows, columns): + width = columns + + for i in range (0, int (rows / 2)): + pattern = "|#|" * ((2 * i) + 1) + print (pattern.center (width, '~')) + + print ("HactoberFest2020".center (width, '-')) + + i = int (rows / 2) + while i > 0: + pattern = "|#|" * ((2 * i) - 1) + print (pattern.center (width, '~')) + i = i-1 + return + +rows = 7 +columns = rows * 3 +doormatDesign(rows, columns)