打印等腰三角形
*
***
*****
*******
for i in range(1,5): for k in range(0,5-i): print(" ",end='') for j in range(1,2*i): print("*",end='') print()
*
* *
* *
*******
for i in range(1,5): for k in range(5-i): print(' ',end='') for j in range(1,2*i): if i == 1 or i == 4 or j == 1 or j == 2*i - 1: print('*',end='') else: print(' ',end='') print()
所思及所学
学而不思则罔,思而不学则殆!