Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- """
- * row = 1: 3 Ssp 1 st : 0 Msp 1 st
- * * row = 2: 2 Ssp 1 st 1 sp 1 st : 1 Msp 2 st
- * * * row = 3: 1 Ssp 1 st 1 sp 1 st 1 sp 1 st : 2 Msp 3 st
- * * * * row = 4: 0 Ssp 1 st 1 sp 1 st 1 sp 1 st 1 sp 1 st : 3 Msp 4 st
- Starting sp = nRows - row
- Middle sp = row - 1
- st = row
- """
- nRows = int(input())
- row = 1
- while row <= nRows:
- string = ''
- Ssp = 0
- while Ssp < (nRows-row):
- string += ' '
- Ssp += 1
- star = 1
- while star <= row:
- if star == row:
- string += '*'
- else:
- string += '* '
- star += 1
- print(string)
- row += 1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement