Write a Python program to accept a positive integer n from the user and then print the following pattern using nested loops. For example, if n = 5, the output should be:
*
* *
* * *
* * * *
* * * * *
Answer:
Answer by student
n = int(input( "Enter a positive integer: " )) for i in range( 1 , n+ 1 ): for j in range(i): print( "*" , end= " " ) print() |
Detailed answer by teachoo
The rest of the post is locked. Join Teachoo Black to see the full post.