You are viewing a single comment's thread. Return to all comments →
N, M = map(int, input().split())
for i in range(N // 2): pattern = ".|." * (2 * i + 1) # repeat .|. (odd times) print(pattern.center(M, "-")) # center with '-' print("WELCOME".center(M, "-")) for i in range(N // 2 - 1, -1, -1): # reverse loop pattern = ".|." * (2 * i + 1) print(pattern.center(M, "-"))
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, M = map(int, input().split())
for i in range(N // 2): pattern = ".|." * (2 * i + 1) # repeat .|. (odd times) print(pattern.center(M, "-")) # center with '-' print("WELCOME".center(M, "-")) for i in range(N // 2 - 1, -1, -1): # reverse loop pattern = ".|." * (2 * i + 1) print(pattern.center(M, "-"))