for i in range(N - 1, 0, -1):
for j in range(1, N - i + 1):
print(' ', end = '')
for l in range(1, 2 * i):
if l == 1 or l == i * 2 - 1:
print('*', end = '')
else:
print(' ', end = '')
print()
covert this program into simple program
N=int(input("Enter an interger: "))
for i in range(N - 1, 0, -1):
for j in range(1, N - i + 1):
print(' ', end = '')
for l in range(1, 2 * i):
if l == 1 or l == i * 2 - 1:
print('*', end = '')
else:
print(' ', end = '')
print()
Comments
Leave a comment