Designer Door Mat

Sort by

recency

|

1735 Discussions

|

  • + 0 comments
    N, M = map(int, input().split(' '))
    count = 1
    for _ in range(N // 2):
        print(f"{'.|.' * count:-^{M}}")
        count += 2
    print(f"{'WELCOME':-^{M}}")
    for _ in range(N // 2):
        count -= 2
        print(f"{'.|.' * count:-^{M}}")
    

    modern method using formatting string 👍

  • + 0 comments

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

    print('WELCOME'.center(M,'-'))
    for i in range(N-2,0,-2):
        x ='.|.'*i
        print (x.center(M,'-'))
    

    else: None

  • + 0 comments
    n, m = map(int, input().split())
    
    x=n//2
    for i in range(x):
        a=".|."*(2*(i+1)-1)
        print(a.center(m,"-"))
    print("WELCOME".center(m, "-"))
    for i in range(x):
        b=".|."*((2*(x-i)-1))
        print(b.center(m,"-")) 
    
  • + 0 comments
    n, m = map(int, input().split())
    sym = 1
    
    for x in range(n):
            if x < n//2:
                print((sym*".|.").center(m,"-"), end="")
                sym += 2
            elif x == n//2:
                print("WELCOME".center(m,"-"), end="")
            else:
                sym -= 2
                print((sym*".|.").center(m,"-"), end="") 
            print("") 
    
  • + 0 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))