Designer Door Mat

Sort by

recency

|

1799 Discussions

|

  • + 0 comments

    It really pushes you to think about formatting and alignment, which are essential for producing clean output—especially in real-world applications like UI layout or console design. Mahadevbook777 Login

  • + 0 comments
    def ceil_div(a, b):
        return - (a // -b)
    
    rows, cols = input().split(" ")
    N = int(rows)
    if (N < 5 or N > 101) or N % 2 != 1:
        raise Exception()
    
    M = int(cols)
    if M != 3 * N:
        raise Exception()
    
    pattern = ".|."
    filler = "-"
    message = "WELCOME"
    
    # Save the generated patterns and pop them out in reverse
    s_list = []
    for row in range(1, N+1):
        if row == ceil_div(N, 2):
            rem = M - len(message)
            print(filler*ceil_div(rem, 2) + message + filler*ceil_div(rem, 2))
    
        elif row > ceil_div(N, 2):
            s = s_list.pop(len(s_list) - 1)
            rem = M - len(s)
            print(filler*ceil_div(rem, 2) + s + filler*ceil_div(rem, 2))
    
        else:
            s = pattern * (row + row-1)
            rem = M - len(s)
            s_list.append(s)
            print(filler*ceil_div(rem, 2) + s + filler*ceil_div(rem, 2))
    
  • + 0 comments

    Enter your code here. Read input from STDIN. Print output to STDOUT

    if name == "main": nums= list(map(int,input().split())) n,m = nums c=".|." sep="-" welcome="WELCOME" steps= list(range(1,n,2)) #print(steps) for i in steps: print((c*i).center(m,sep)) print(welcome.center(m,sep)) steps.reverse() for i in steps: print((c*i).center(m,sep))

  • + 0 comments
    n, m = map(int, input().split())
    for i in range(1, n, 2):
        print((".|." * i).center(m, "-"))
    print("WELCOME".center(m, "-"))``
    for i in range(n-2, 0, -2):
        print((".|." * i).center(m, "-"))
    
  • + 0 comments

    R,C=map(int,input().split(' ')) for i in range (1,R,2): print((".|."*i).center(C,'-')) print("WELCOME".center(C,'-')) for j in range (R-2,-1,-2): print((".|."*j).center(C,'-'))