Question #301749
Write a program to print W pattern of N lines using a asterisk(*) character
NOTE : There is a space after each asterisk (*) character.
Input:
The first line is an integer N
Explanation:
For N=5
The output should be
* * * * * * * * *
* * * * * * * *
* * * * * *
* * * *
* *
'''
Write a program to print W pattern of N lines using a asterisk(*) character
NOTE : There is a space after each asterisk (*) character.
Input:
The first line is an integer N
Explanation:
For N=5
The output should be
* * * * * * * * *
* * * * * * * *
* * * * * *
* * * *
* *
'''
N = int(input("Enter N = "))
u = (2*N)-1
for r in range(0,N):
s=""
for c in range(0,u): s = s + "* "
if(r==0): u = u-1
else:
u = u-2
print(s)
Comments
Leave a comment