
소스 코드
# 변수 선언
inputNum = int(input())
# 별모양 표현
for i in range(1,inputNum+1):
print('*'*i)
for j in range(inputNum-1, 0, -1):
print('*'*j)
출력 결과

# 변수 선언
inputNum = int(input())
# 별모양 표현
for i in range(1,inputNum+1):
print('*'*i)
for j in range(inputNum-1, 0, -1):
print('*'*j)
[백준알고리즘] 10996번 별 찍기 - 21 파이썬(Python) (0) | 2020.09.01 |
---|---|
[백준알고리즘] 2446번 별 찍기 -9 파이썬(Python) (0) | 2020.08.31 |
[백준알고리즘] 5543번 상근날드 파이썬(Python) (0) | 2020.08.29 |
[백준알고리즘] 10039번 평균 점수 파이썬(Python) (0) | 2020.08.28 |
[백준알고리즘] 14681번 사분면 고르기 파이썬(Python) (0) | 2020.08.27 |