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