Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 6a7939c

Browse files
committedMay 13, 2024
local update & Lv0 Python: 181833
1 parent 6044d66 commit 6a7939c

File tree

2 files changed

+22
-0
lines changed

2 files changed

+22
-0
lines changed
 
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
def solution(n):
2+
answer = [[1 if i == j else 0 for j in range(n)] for i in range(n)]
3+
return answer
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
def solution(n):
2+
answer = ''
3+
4+
for i in range(0, n):
5+
if i % 2:
6+
answer += '박'
7+
else:
8+
answer += '수'
9+
return answer
10+
11+
12+
# 다른풀이
13+
def solution_b(n):
14+
string = "수박" * n
15+
16+
return string[:n]
17+
18+
19+
print(solution(3))

0 commit comments

Comments
 (0)
Please sign in to comment.