Write a program to print a pyramid of N rows
+ + + + * + + + +
+ + + * * * + + +
+ + * * * * * + +
n=int(input('Number Rows Pyramid: ')) for i in range(n): l=(n*n)//2-i r=(n*n)//2+i s='' for j in range(n*n): if j>=l and j<=r: s+='*' else: s+='+' print(s)
Need a fast expert's response?
and get a quick answer at the best price
for any assignment or question with DETAILED EXPLANATIONS!
Comments