Computer Science, asked by anindyaadhikari13, 4 months ago

Python códe for this pattern upto n rows?

*
* *
* * *
* * * *
* * * * *

Write one line códe for this question.​

Answers

Answered by Oreki
3

Program:

 print(*["\n" + "* " * i for i in range(1, int(input("Enter N - ")) + 1)])

Algorithm:

  • Accepting the number of rows to be printed.
  • Creating the pattern by copying the '*' i times.
  • Unpacking the list, therefore printing the pattern in the screen.
Attachments:

anindyaadhikari13: Awesome.
Oreki: Thanks!
Answered by beauty1239
2

\tt {I've \:  clicked \:  the \:  answers  \: from \:  my \:  comp.}</p><p>

 \tt{That's  \: why \:  it's \:  a \:  bit \:  blurry \:  but \:  readable.}

Attachments:

RockingStarPratheek: The Questioner needs only one line Codè. Kindly Correct it !
Similar questions