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, "-"))




codesadda.com

Codesadda.com is your home of programming solutions, tutorials, video tutorials and much more. Sign Up for our weekly newsletter to get update about new content.

Like us on Facebook | Connect with us on LinkedIn | Subscribe our Channel on Youtube