for n in range(1,5): #上半部分for i in range(1,6-n):print(' ',sep='',end='')for j in range(1,2*n):if j==1 or j==2*n-1:print('*',sep='',end='')else :print(' ',sep='',end='')print() for n in range(5,0,-1): #下半for i in range(1,6-n):print(' ',sep='',end='')for j in range(1,2*n):if j == 1 or j == 2 * n - 1:print('*', sep='', end='')else:print(' ', sep='', end='')print()