Answers for "Designer Door Mat"

1

Designer Door Mat

N, M = map(int,input().split())
for i in range(1,N,2): 
    print((i * ".|.").center(M, "-"))
print("WELCOME".center(M,"-"))
for i in range(N-2,-1,-2): 
    print((i * ".|.").center(M, "-"))
Posted by: Guest on July-06-2021
0

Designer Door Mat

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]))
Posted by: Guest on October-04-2021

Browse Popular Code Answers by Language