Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- *
- * *
- * * *
- * * * *
- * * * * *
- rows = 5
- for i in range(0, rows):
- for j in range(0, i + 1):
- print("*", end=' ')
- print()
- 1
- 2 2
- 3 3 3
- 4 4 4 4
- 5 5 5 5 5
- rows = 6
- for i in range(rows):
- for j in range(i):
- print(i, end=' ')
- print('')
- 1
- 1 2
- 1 2 3
- 1 2 3 4
- 1 2 3 4 5
- rows = 5
- for i in range(1, rows + 1):
- for j in range(1, i + 1):
- print(j, end=' ')
- print('')
- 1
- 2 3
- 4 5 6
- 7 8 9 10
- 11 12 13 14 15
- rows = 5
- counter = 1
- for i in range(1, rows + 1):
- for j in range(1, i + 1):
- print(counter, end=' ')
- counter += 1
- print('')
- *
- * *
- * * *
- * * * *
- * * * * *
- size = 5
- m = (2 * size) - 2
- for i in range(0, size):
- for j in range(0, m):
- print(end=" ")
- m = m - 1
- for j in range(0, i + 1):
- print("* ", end=' ')
- print(" ")
- ''' OR
- n = 5
- for i in range(n):
- print(' '*(n-i-1) + '* ' * (i))
- print()
- '''
- * * * * *
- * * * *
- * * *
- * *
- *
- size = 5
- m = 0
- for i in range(size, 0, -1):
- for j in range(0, m):
- print(end=" ")
- m = m + 1
- for j in range(0, i):
- print("* ", end=' ')
- print(" ")
- ''' OR
- n = 5
- for i in range(n-1,-1,-1):
- print(' ' * (n - i - 1) + '* ' * (i))
- '''
- *
- * *
- * * *
- * * * *
- * * *
- * *
- *
- rows = 3
- k = 2 * rows - 2
- for i in range(0, rows):
- for j in range(0, k):
- print(end=" ")
- k = k - 1
- for j in range(0, i + 1):
- print("* ", end="")
- print("")
- k = rows - 2
- for i in range(rows, -1, -1):
- for j in range(k, 0, -1):
- print(end=" ")
- k = k + 1
- for j in range(0, i + 1):
- print("* ", end="")
- print("")
- '''OR
- n = 3
- for i in range(n):
- print(' '*(n-i-1) + '*' * (2*i+1))
- for i in range(n-2,-1,-1):
- print(' ' * (n - i - 1) + '*' * (2 * i + 1))'''
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement