Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

python pyramid

for row in range(row_len := int(input("Enter the length of the pyramid: "))):
    print(((row_len * 2 - 1) // 2 - row) * " " + "* " * (row + 1))
# By Omar Alanazi
# Output example (if user enters 3)
#  * 
# * * 
#* * * 
Source by www.tutorialstonight.com #
 
PREVIOUS NEXT
Tagged: #python #pyramid
ADD COMMENT
Topic
Name
6+7 =