Write program to print the following shape
Attachments:
Answers
Answered by
0
Answer:
shift + 8 and use enter keys to make this
Explanation:
hope it's helpful to you
Answered by
1
Answer:
n = 4 # number of row
#upper half
for i in range(1, n+1) :
#while loop for * and spaces
x = 1
while x < 2 * i :
if x == 1 or x == 2 * i - 1 :
print('*', end = '')
else :
print(' ', end = '')
x += 1
print()
#lower half
for i in range(n-1, 0, -1) :
#while loop for * and spaces
x = 1
while x < 2 * i :
if x == 1 or x == 2 * i - 1 :
print('*', end = '')
else :
print(' ', end = '')
x += 1
print()
Similar questions