From fa4eb9cf75ce0aaac0551f10d25b907325cccc47 Mon Sep 17 00:00:00 2001 From: Gaurav Yadav <25082341+OOGaurav@users.noreply.github.com> Date: Wed, 30 Oct 2019 16:23:38 +0530 Subject: [PATCH] Designer Door Mat --- Python/03. Strings/Designer Door Mat.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 Python/03. Strings/Designer Door Mat.py diff --git a/Python/03. Strings/Designer Door Mat.py b/Python/03. Strings/Designer Door Mat.py new file mode 100644 index 0000000..95d38b9 --- /dev/null +++ b/Python/03. Strings/Designer Door Mat.py @@ -0,0 +1,15 @@ +ip = list(map(int, input().split())) +n = ip[0] +m = ip[1] +welLine = int(n/2) +d = '.|.' +for i in range(n): + if i < welLine: + des = d*(2*i+1) + elif i == welLine: + des = 'WELCOME' + prev = 2*i-1 + else: + des = d*(prev) + prev -= 2 + print(des.center(m, '-')) \ No newline at end of file