Computer Science, asked by Anthaea, 1 month ago

Write a python program to generate the following pattern using nested loop function.

Attachments:

Answers

Answered by Oreki
20

{\bf Co de}

   \texttt{for row in range(5, 0, -1): \# Goes from 5 to 1.}\\\texttt{\hspace{1.5em} for column in range(1, row + 1): \# Goes from 1  until the row.}\\\texttt{\hspace{3em} print(column, end=" ")}\\\texttt{\hspace{1.5em} print()}

{\bf Out put}

   \texttt{1 2 3 4 5}\\\texttt{1 2 3 4}\\\texttt{1 2 3}\\\texttt{1 2}\\\texttt{1}

Similar questions