Input Format
A single line containing the space separated values of  and .
Constraints
Output Format
Output the design pattern.

hackerrank designer door mat problem solution in python programming

Problem solution in python 2 programming language.

N,M = map(int,raw_input().split())
for i in xrange(1, N, 2): 
    print ( str('.|.')*i ).center(M, '-')
print str('WELCOME').center(M, '-')
for i in xrange(N-2, -1, -2): 
    print ( str('.|.')*i ).center(M, '-')

Problem solution in python 3 programming language.

n, m = map(int,input().split())
pattern = [('.|.'*(2*i + 1)).center(m, '-') for i in range(n//2)]
print('\n'.join(pattern + ['WELCOME'.center(m, '-')] + pattern[::-1]))

Second solution

N,M = map(int,input().split())
for i in xrange(1, N, 2): 
    print(( str('.|.')*i ).center(M, '-'))
print(str('WELCOME').center(M, '-'))
for i in xrange(N-2, -1, -2): 
    print(( str('.|.')*i ).center(M, '-'))