HackerRank- Python Designer Door Mat

Problem 10:

Mr. Vincent works in a door mat manufacturing company. One day, he designed a new door mat with the following specifications:

Mat size must be N X M. (N is an odd natural number, and M is 3 times N.)
The design should have 'WELCOME' written in the center.
The design pattern should only use |, . and - characters.

  1. N, M = map(int,input().split())
  2. for i in range(1,N,2):
  3. print((i * ".|.").center(M, "-"))
  4. print("WELCOME".center(M,"-"))
  5. for i in range(N-2,-1,-2):
  6. print((i * ".|.").center(M, "-"))

download android app