Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

pyramid pattern in python

n = 3
for i in range(1, n+1):
  print(f"{' '*(n-i)}{' *'*i}"[1:])
  
# Output:
#  *
# * *
#* * *
Source by www.programiz.com #
 
PREVIOUS NEXT
Tagged: #pyramid #pattern #python
ADD COMMENT
Topic
Name
6+7 =