Answer to Question #301749 in Python for Vini

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


* * * * * * * * *


* * * * * * * *


* * * * * *


* * * *


* *

1
Expert's answer
2022-02-23T12:18:41-0500
n = int(input())

for i in range(n):
    m = n - i
    for j in range(m):
        print('* *', end=' ')
    print('\n')

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS