Print pyramid on console in Python,
A
A*A
A*A*A
A*A*A*A
A*A*A*A*A
str1=''
i=1
while(i<=5):
k=5-i-1
while(k>=0):
str1=str1+' '
k=k-1
j=i+i-1
while(j>0):
if j%2==0:
str1=str1+'*'
else:
str1=str1+'A'
j=j-1
i=i+1
str1=str1+"\n"
print(str1)