Triangle Number Pattern in Python |
In this article, we are going to write a Python code to print out the number pattern in Python
If you are looking for Python Tutorial Series then it's here
def rows(n):
for i in range(1,n+1):
for j in range(1,i+1):
print(j,end='')
print('')
rows(5)
rows(4)
The output of the above Python Program is:
1
12
123
1234
12345
1
12
123
1234
Comments
Post a Comment