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.
- Prepare
- Python
- Strings
- Designer Door Mat
- Discussions
Designer Door Mat
Designer Door Mat
Sort by
recency
|
1735 Discussions
|
Please Login in order to post a comment
modern method using formatting string 👍
N , M = input().split() N = int(N) M = int(M) if(N%2 != 0 and M == 3*N): for i in range (1,N,2): x=".|."*(i) print (x.center(M,'-'))
else: None
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))