Programming Examples
Python program to print Floyds triangle
Write a program to print Floyd's triangle as shown below:
1
2 3
4 5 6
7 8 9 10
11 12 13 14 15
Solution
x=1
for a in range(1,6):
for b in range(1,a+1):
print(x,end=' ')
x=x+1
print()
Output
1
2 3
4 5 6
7 8 9 10
11 12 13 14 15