WRITE A PYTHON PROGRAM TO PRINT THE FOLLOWING PATTERN.............
#CONTENT QUALITY REQUIRED
#NO SPAMS
#RIGHT ANSWER WILL BE MARKED BRAINLIEST
Answers
for i in range(6):
spaces = i #The number of spaces in the beginning of row.
row = [j+1 for j in range(6-i)] + [(6-i-1)-j for j in range(6-i-1)] #Add numbers into row.
row_string = ' '.join(map(str, row)) #Convert list to string. Use map to turn ints in list to strings.
for j in range(spaces):
row_string = ' ' + ' ' + row_string
print(row_string)
Hey there!
Here's your code.
# Python Program Using For Loop To Print Full Inverted Triangle Pyramid Of Numbers
# Author : Mahnaz @NamkeenCandy
print("\t\t\t\tFull Inverted Triangle Pyramid of Numbers")
limit = spacecount = 6
# I am putting 6 because it's been asked in your question
# Here you can use any number instead of 6
while limit:
print(' '*(spacecount-limit), end='')
for _ in range(1,limit+1):
print(_, end='')
for _ in range(limit-1, 0, -1):
print(_, end='')
print('')
limit -=1
______________________________
See the attachment for proper review.
______________________________