W pattern with *
This Program name is W pattern with *. Write a Python program to W pattern with *, it has two test cases
The below link contains W pattern with * question, explanation and test cases
https://drive.google.com/file/d/1gcmmsSrPkGTY3aHoyGuw-x3qFFFnLTeb/view?usp=sharing
We need exact output when the code was run
N = int(input())
print("* " * (2 * N - 1))
for k in range(1, N):
print(" " * k, end="")
print("* " * (N - k), end="")
print(" " * (k - 1), end="")
print("* " * (N - k))
Comments
Leave a comment