Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # 1
- # 1 2 1
- # 1 2 3 2 1
- # 1 2 3 4 3 2 1
- #1 2 3 4 5 4 3 2 1
- user_rows = int( input() )
- for row in range(1, user_rows + 1):
- #Front side space
- print( " " * (2 * (user_rows - row)), end = '' )
- #Ascending order Pattern
- print( " ".join( str(icounter) for icounter in range(1, row + 1)), end = '' )
- #Middle space between both ascending and descending pattern
- if not row == 1:
- print(" ", end = '')
- #Descending order Pattern
- print( " ".join( str(icounter) for icounter in range(row-1, 0, -1)), end = '' )
- #Next line at all lines except last one
- if not row == user_rows:
- print("")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement