Last active
December 6, 2025 12:40
-
-
Save delululala/e02d15ef04d1e7045837e290145d7a6e to your computer and use it in GitHub Desktop.
누구나 쉽게 할 수 있는 소프트웨어 설계와 파이썬
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
| class Student: | |
| def __init__(self, student_id, student_name, student_year, student_major): | |
| self.student_id = student_id | |
| self.student_name = student_name | |
| self.student_year downloads= student_year | |
| self.student_major = student_major | |
| def sugang(self): | |
| print(f"{self.student_name} 학생의 수강신청이 완료되었습니다.") | |
| def search_score(self, student_id): | |
| if student_id == self.student_id: | |
| print(f"{self.student_name} 학생의 성적증명서입니다.") | |
| else: | |
| print("해당 학번의 학생을 찾을 수 없습니다.") | |
| def search_attending(self, student_id): | |
| if student_id == self.student_id: | |
| print(f"{self.student_name} 학생의 재학증명서입니다.") | |
| else: | |
| print("해당 학번의 학생을 찾을 수 없습니다.") | |
| # 객체 생성 | |
| student1 = Student(2023212, "홍길동", 1, "영문학과") | |
| student2 = Student(2022475, "김길동", 1, "국문학과") | |
| # 출력 예시 | |
| print("학생1 정보:") | |
| print(student1.student_id, student1.student_name, student1.student_year, student1.student_major) | |
| student1.sugang() | |
| student1.search_score(2023212) | |
| student1.search_attending(2023212) | |
| print("\n학생2 정보:") | |
| print(student2.student_id, student2.student_name, student2.student_year, student2.student_major) | |
| student2.sugang() | |
| student2.search_score(2022475) | |
| student2.search_attending(2022475) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment