From 4feb5e80cac79bb2522dec9ea7c702bd81e7f262 Mon Sep 17 00:00:00 2001 From: Aditi Jain Date: Sun, 16 Oct 2022 23:35:16 +0530 Subject: [PATCH] Adding Designer Door Mat --- python/Designer_Door_Mat.py | 39 +++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 python/Designer_Door_Mat.py diff --git a/python/Designer_Door_Mat.py b/python/Designer_Door_Mat.py new file mode 100644 index 0000000..361ead1 --- /dev/null +++ b/python/Designer_Door_Mat.py @@ -0,0 +1,39 @@ +x=input() +x=x.split() +n=int(x[0]) +m=int(x[1]) +lst = [] +for i in range(1,n//2+1): + temp="" + for j in range(2*i-1): + temp = temp+".|." + lst.append(temp.center(m,"-")) +lst.append("WELCOME".center(m,"-")) +for x in lst: + print(x) +lst.reverse() +for i in range(1,len(lst)): + print(lst[i]) + +# Example Test Cases +# Size: 7 x 21 +# ---------.|.--------- +# ------.|..|..|.------ +# ---.|..|..|..|..|.--- +# -------WELCOME------- +# ---.|..|..|..|..|.--- +# ------.|..|..|.------ +# ---------.|.--------- + +# Size: 11 x 33 +# ---------------.|.--------------- +# ------------.|..|..|.------------ +# ---------.|..|..|..|..|.--------- +# ------.|..|..|..|..|..|..|.------ +# ---.|..|..|..|..|..|..|..|..|.--- +# -------------WELCOME------------- +# ---.|..|..|..|..|..|..|..|..|.--- +# ------.|..|..|..|..|..|..|.------ +# ---------.|..|..|..|..|.--------- +# ------------.|..|..|.------------ +# ---------------.|.--------------- \ No newline at end of file