import math
s = [' * ', ' * * ', '***** ']
def make_fractal(shift):
c = len(s)
for i in range(c):
s.append(s[i] + s[i])
s[i] = (" " * shift + s[i] + " " * shift)
n = int(input())
k = int(math.log(int(n / 3), 2))
for i in range(k):
make_fractal(int(pow(2, i)))
for i in range(n):
print(s[i])
'# 코딩 문제 관련 > 파이썬' 카테고리의 다른 글
Baekjoon 2577번(python) (0) | 2019.04.28 |
---|---|
Baekjoon 1152번(python) (0) | 2019.04.28 |
Baekjoon 1065번(python) (0) | 2019.04.28 |
Baekjoon 4673번(python) (0) | 2019.04.28 |
Baekjoon 1110번(python) (0) | 2019.04.27 |