[PS] 구현: 2439 별찍기 - 2

devhans·2024년 8월 27일
0

PS

목록 보기
11/20
post-thumbnail

문제 출처

https://www.acmicpc.net/problem/2439

포인트

range 함수를 통해 쉽게 리스트를 만들고 순회할 수 있다.

코드

import sys

fast_input = sys.stdin.readline
fast_print = sys.stdout.write

line = int(fast_input().rstrip())
for idx in range(line):
    fast_print(" " * (line-(idx+1)) + "*" * (idx + 1) + "\n")
profile
책 읽고 운동하기

0개의 댓글