Computer Science, asked by anushkajaitlia, 11 months ago

Python
Pattern
printing
*
* *
* * * ​

Answers

Answered by tamaghnadey1916
0

Answer:

for i in range (1,4): print (i * " * ")

Explanation:

The above is your answer.

i iterates from 1 to less than 4 i.e. 3

when i is 1 it prints 1* "*" i.e. 1 time "*"

when 2 prints 2 asterisks

when 3 prints 3 asterisks

Very easy I hope that helps you

BYE

DON'T FORGET TO MARK ME THE BRAINLIEST

Answered by Anonymous
3

Required pattern :-

n= int(input ("Enter the number of rows : "))

for i in range (1,n+1):

print("* "*i)

Explanation :-

Here we will ask the user to enter the number of rows, as given in the question we have to print the pattern for 3 rows. Assume that the input value is 3, than the i loop will run from 1 to 3, and starts will be printed times i.

When i = 1, stars would be printed 1 time = *

When i = 2, stars would be printed 2 times = * *

When i = 3, stars would be printed 3 times = * * *

So the pattern obtained would be :-

*

* *

* * *

Similar questions