Given an integer number
N as input. Write a program to print the hollow right-angled triangular pattern of N lines as shown below.Note: There is a space after each asterisk (*) character.
#Python 3.9.5
N=int(input("Enter number of lines: "))
for i in range(N):
for j in range(i+1):
if j==0 or j==i or i==N-1:
print('*',end=" ")
else:
print(" ", end=" ")
print()
Comments
Leave a comment