Answer to Question #350294 in Python for alex

Question #350294


5 Display the following pattern using only 2 lines of code. Use only 1 for loop. This problem will require

the use of the multiplication operator (*) and the variable that keeps track of the number of loop

iterations.


Sample output: *

***

*****

*******

*********

***********

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




1
Expert's answer
2022-06-13T08:26:16-0400
for i in range(int(input())):
    print('*'*((i*2)+1))

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
APPROVED BY CLIENTS