Answer to Question #101741 in Python for lewis

Question #101741
Use python to write a program that uses looping to output the following shape. Use i And j for range.

*
* *
* * *
* * * *
* * * * *
* * * * * *
* * * * * * *
* * * * * * * *
* * * * * * * * *
1
Expert's answer
2020-01-28T06:16:38-0500

needed_list = []

count = '* '

for i in range(18):

if i % 2 == 0:

needed_list.append('')

else:

needed_list.append(count)

count += '* '


for j in needed_list:

    print(j.strip())

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS