Created
May 18, 2019 09:20
-
-
Save rkdgusrn1212/0c4205ebf3bcd6f2b008259650a2df84 to your computer and use it in GitHub Desktop.
파이썬으로 n 높이의 숫자 피라미드 출력
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#입력 : int 자료형 1개(n) | |
#출력 : n 의 길이를 가지는 숫자 피라미드 | |
n = int(input()) | |
for i in range(n): # 0부터 n-1까지 반복 | |
line_str = "" #해당 줄의 문자열을 선언 | |
for j in range(i+1):#0부터 i까지 반복 | |
line_str += str(j+1) #해당 줄 문자열에 해당 숫자를 더한다. | |
print(line_str)#해당 줄 출력 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment