- To print half triangle pattern using number
User Input: 3
Output:
1 2 2 3 3 3
rows=int(input("Enter number of rows : "))
for i in range(1,rows+1):
for j in range(1,i+1):
print(i,end=" ")
print("")
Enter number of rows : 4 1 2 2 3 3 3 4 4 4 4Program
Main logic :
c=65 # "A" starts from 65
for i in range(1,rows+1): #rows : number of rows to print
for j in range(1,i+1):
print(i,end=" ")
print("")
Concept
Coming Soon !
QuickIf your happiness depends on what somebody else does, I guess you do have a problem.