Spocoman

01. Number Pyramid

Dec 30th, 2021 (edited)
148
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.21 KB | None | 0 0
  1. num = int(input())
  2. counter = 1
  3.  
  4. for row in range(1, num + 1):
  5.     for col in range(row):
  6.         if counter > num:
  7.             break
  8.         print(' ', end=f'{counter}')
  9.         counter += 1
  10.     print()
  11.  
Add Comment
Please, Sign In to add comment