n = 40
for i in range(1, 11):
print(' ' * n, end='')
print('* ' * i)
n = n - 1
# the simplified version of the above code:
for i in range(1, 11):
print(' ' * (n - i) + '* ' * i)
# ------------------------------------------------------------------------------------------------------------------------ #
Output :
*
* *
* * *
* * * *
* * * * *
* * * * * *
* * * * * * *
* * * * * * * *
* * * * * * * * *
* * * * * * * * * *
# ------------------------------------------------------------------------------------------------------------------------ #
No comments:
Post a Comment
Hi User, Thank You for visiting My Blog. Please post your genuine Feedback or comments only related to this Blog Posts. Please do not post any Spam comments or Advertising kind of comments which will be Ignored.