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: *
***
*****
*******
*********
***********
*************
for i in range(int(input())):
print('*'*((i*2)+1))
Comments
Leave a comment