We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
n=(input())
a=n.split(" ")
b=int(a[0])
c=int(a[1])
p1="-"
p2=".|."
w="WELCOME"
for i in range(b//2):
pattern=p2*((2*i)+1)
hypens=((c-len(pattern))//2)
print((p1*hypens)+pattern+(p1*hypens))
center=(c-7)//2
print( center*p1+ w + center*p1)
for i in range(b//2 -1,-1,-1):
pattern=p2*((2*i)+1)
hypens=((c-len(pattern))//2)
print((p1*hypens)+pattern+(p1*hypens))
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Designer Door Mat
You are viewing a single comment's thread. Return to all comments →
n=(input()) a=n.split(" ") b=int(a[0]) c=int(a[1]) p1="-" p2=".|." w="WELCOME" for i in range(b//2): pattern=p2*((2*i)+1) hypens=((c-len(pattern))//2) print((p1*hypens)+pattern+(p1*hypens)) center=(c-7)//2
print( center*p1+ w + center*p1) for i in range(b//2 -1,-1,-1): pattern=p2*((2*i)+1) hypens=((c-len(pattern))//2) print((p1*hypens)+pattern+(p1*hypens))