Computer Science, asked by santoshlovely19806, 5 months ago

write a program in python that displays the following pattern::
1
1*
1*#
1*#*
1*#*#

Answers

Answered by allysia
0

Answer:

Here you go:

\\\tt n= int( in put("Enter\ the\ number\ of\ rows: ")) \\\tt pre='1' \\\tt print(1) \\\tt for\ i\ in\ range(1,n): \\\tt{\qquad    if\ i\%2==0:}\\\tt{\qquad{\qquad  pre+="*"}} \\\tt{\qquad    else:}\\\tt{\qquad{\qquad        pre+="\#"}}\\\tt{\qquad    print(pre)}

Attachment for satisfaction:

Attachments:
Similar questions