내용 |
#%%
dan = 5
for i in range(0, dan):
for j in range(0, dan-i-1):
print(' ', end='')
for j in range(0, (i*2)+1):
print('*', end='')
print()
for i in range(0, dan-1):
for j in range(0,i+1):
print(' ', end='')
for j in range(0,2*(dan-i)-3):
print('*', end='')
print()
#%%
dan = 5
for i in range(0, dan):
for j in range(0, dan-i-1):
print(' ', end='')
for j in range(0,(i*2)+1):
if j==2*i or j==0:
print('*', end='')
else:
print(' ', end='')
print()
for i in range(0, dan-1):
for j in range(0,i+1):
print(' ',end='')
for j in range(0,2*(dan-i)-3):
if j==0 or j==2*(dan-i)-4:
print('*', end='')
else:
print(' ', end='')
print()
#%%
dan = 5
for i in range(0, dan):
for j in range(0, dan-i-1):
print(' ', end='')
for j in range(0, (i*2)+1):
if j==2*i or j==0:
print('*', end='')
else:
if j%2==0:
print('$', end='')
else:
print(' ', end='')
print()
for i in range(0, dan-1):
for j in range(0, i+1):
print(' ', end='')
for j in range(0, 2*(dan-i)-3):
if j==0 or j==2*(dan-i)-4:
print('*', end='')
else:
if j%2==0:
print('$', end='')
else:
print(' ', end='')
print()
|