Skip to content

Commit f91f658

Browse files
Create designer_door_met.py
1 parent 350dcb3 commit f91f658

File tree

1 file changed

+64
-0
lines changed

1 file changed

+64
-0
lines changed

challenges/designer_door_met.py

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
'''
2+
Mr. Vincent works in a door mat manufacturing company. One day, he designed a new door mat with the following specifications:
3+
4+
Mat size must be X. ( is an odd natural number, and is times .)
5+
The design should have 'WELCOME' written in the center.
6+
The design pattern should only use |, . and - characters.
7+
Sample Designs
8+
9+
Size: 7 x 21
10+
---------.|.---------
11+
------.|..|..|.------
12+
---.|..|..|..|..|.---
13+
-------WELCOME-------
14+
---.|..|..|..|..|.---
15+
------.|..|..|.------
16+
---------.|.---------
17+
18+
Size: 11 x 33
19+
---------------.|.---------------
20+
------------.|..|..|.------------
21+
---------.|..|..|..|..|.---------
22+
------.|..|..|..|..|..|..|.------
23+
---.|..|..|..|..|..|..|..|..|.---
24+
-------------WELCOME-------------
25+
---.|..|..|..|..|..|..|..|..|.---
26+
------.|..|..|..|..|..|..|.------
27+
---------.|..|..|..|..|.---------
28+
------------.|..|..|.------------
29+
---------------.|.---------------
30+
Input Format
31+
32+
A single line containing the space separated values of and .
33+
34+
Constraints
35+
36+
Output Format
37+
38+
Output the design pattern.
39+
40+
Sample Input
41+
42+
9 27
43+
Sample Output
44+
45+
------------.|.------------
46+
---------.|..|..|.---------
47+
------.|..|..|..|..|.------
48+
---.|..|..|..|..|..|..|.---
49+
----------WELCOME----------
50+
---.|..|..|..|..|..|..|.---
51+
------.|..|..|..|..|.------
52+
---------.|..|..|.---------
53+
------------.|.------------
54+
'''
55+
# Enter your code here. Read input from STDIN. Print output to STDOUT
56+
57+
s=list(map(int,input().split()))
58+
for i in range(1,s[0]//2+1):
59+
p='.|.'*(2*i-1)
60+
print(p.center(s[1],'-'))
61+
print('WELCOME'.center(s[1],'-'))
62+
for i in range(s[0]//2,0,-1):
63+
p='.|.'*(2*i-1)
64+
print(p.center(s[1],'-'))

0 commit comments

Comments
 (0)