<aside> 👉 제출 안내

</aside>


https://notion-widget-kit.vercel.app/timer?목표일=20250121&목표시간=1630&글꼴번호=2&크기=20&굵기=3&머리말=✅제출까지&꼬리말=남음🔥&외부간격=20&내부간격=10&배경색=White&글자색=Black


<aside> ✅

선행 커맨드

import seaborn as sns
import pandas as pd

</aside>

<aside> ◾

문제 1



Skeleton code

diamonds = sns.load_dataset("diamonds")

# Categorical -> String 변환
diamonds["cut"] = diamonds["cut"].astype(str)
diamonds["color"] = diamonds["color"].astype(str)
diamonds["clarity"] = diamonds["clarity"].astype(str)

"""
코드 입력
"""

# 결과 출력
print(diamonds.shape)
print(diamonds.head())

출력 결과

'''
(53920, 11)
   carat cut color clarity  depth  table  price     x     y     z     volume
0   0.23   5     1       1   61.5   55.0    326  3.95  3.98  2.43  38.202030
1   0.21   4     1       1   59.8   61.0    326  3.89  3.84  2.31  34.505856
2   0.23   2     1       2   56.9   65.0    327  4.05  4.07  2.31  38.076885
3   0.29   4     2       2   62.4   58.0    334  4.20  4.23  2.63  46.724580
4   0.31   2     3       1   63.3   58.0    335  4.34  4.35  2.75  51.917250
'''

</aside>

<aside> ◾

문제 2 - 학생 성적 관리 시스템


  1. 학생들의 이름과 성적을 딕셔너리에 저장하고, 출력하는 함수를 작성하세요. (add_student(grades, name, score))
  2. 성적 평균을 반환하는 함수를 작성하세요. (calculate_average(grades))
  3. 최고 점수 학생을 반환하는 프로그램 작성하세요. (find_top_students(grades))

Skeleton code

def add_student(grades, name, score):
		"""
		코드 작성
		"""

def calculate_average(grades):
    """
    코드 작성
    """

def find_top_student(grades):
    """
    코드 작성
    """

# Example usage
grades = {}
add_student(grades, "Alice", 85)
add_student(grades, "Bob", 92)
add_student(grades, "Charlie", 78)

print(f"Average score: {calculate_average(grades):.2f}")
top_student, top_score = find_top_student(grades)
print(f"Top student: {top_student} with score {top_score}")

출력 결과

"""
Added Alice with score 85.
Added Bob with score 92.
Added Charlie with score 78.
Average score: 85.00
Top student: Bob with score 92
"""

</aside>


<aside> 👉 제출

</aside>


https://notion-widget-kit.vercel.app/timer?목표일=20250121&목표시간=1630&글꼴번호=2&크기=20&굵기=3&머리말=✅제출까지&꼬리말=남음🔥&외부간격=20&내부간격=10&배경색=White&글자색=Black


Copyright ⓒ 2025 TeamSparta All rights reserved.