본문 바로가기
Python

반복문 연습 - 2444

by soojitasan 2024. 6. 17. 23:22
## 2444 별찍기 - 7
n = int(input())

for i in range(1, 2*n):
  if i <= (n):  ##
    a = ('*' * ((i*2)-1))
    print(a.center(2*n-1))
  else:
    b = ('*' * ((((2*n)-i)*2)-1))
    print(b.center(2*n-1))

 

백준에서 왜 틀렸다고 나오는지 모르겠다