Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions silver/programmers/day9/등수 매기기.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# 1.
# ex. [[80, 70], [90, 50], [40, 70], [50, 80]]

def solution(score):
average = [] # Q. 평균 변수 이름으로 average 괜찮나요?
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

굿
avg도 많이 써요

answer = []
for grade in score:
average.append(sum(grade) // len(grade))
average = sorted(average, reverse=True)
# print(average) : [75, 70, 65, 55]
for grade in score:
answer.append(average.index(sum(grade) // len(grade))) # Q. [[1, 2], [1, 1], [1, 1]] : [1, 1, 1]을 어떻게 처리할지 궁금합니다.
return [idx + 1 for idx in answer] # = list(map(lambda idx: idx + 1, answer))