Back

pattern problem in codekata

Created 3 years ago
99 Views
2 Comments
shwetakdQHtb
@shwetakdQHtb
shwetakdQHtb
@shwetakdQHtbProfile is locked. Login

Generate a floyd's triangle.

Sample Input :
5
Sample Output :
1
2 3
4 5 6
7 8 9 10
11 12 13 14 15

my code is-
n= 1
m=2
a=int(input())
for i in range(a):
    for j in range(1,m):
        print(n,end=" ")
        n=n +1
    print("")
    m=m+1

my actual and expected output same but still it not satisfy desired conditions
Comments (2)
Please login to comment.