fork download
  1. rows = 5
  2. for i in range(1, rows + 1):
  3. for j in range(1, rows + 1):
  4. if j <= i:
  5. print(i, end=' ')
  6. else:
  7. print(j, end=' ')
  8. print()
Success #stdin #stdout 0.03s 9516KB
stdin
Standard input is empty
stdout
1 2 3 4 5 
2 2 3 4 5 
3 3 3 4 5 
4 4 4 4 5 
5 5 5 5 5