Please work on : exercise.py
Why do we want to do this assignment? What do we want to accomplish?
- Describe homework here
- How to do this homework
- This repository is for a numerical analysis assignment writing one or more python functions in
exercise.py. classroom.ymlfile is at.github/workflows/folder..githubfolder is hidden on the Linux operating system but will be visible on the Github repository.- Please set environment variable
vars.ECA_HW_???in theclassroom.ymlin the repository settings (Settings > Secrets and Variables > Actions > Variables) to your grader image (e.g.,ghcr.io/your-org/eca-pytest-???:latest). - Set your AI feedback natural language in
classroom.yml. - All executable lines in the
exercise.pyfile should belong to a function. Please do not include any other code outside of the function.
| Argument 인자 |
Data Type 자료형 |
Description 설명 |
|---|
`a` | `float` | coefficient<br>계수
`x` | `List[float]` | a vector<br>벡터
| Return Value 반환값 |
Data Type 자료형 |
Description 설명 |
|---|
`y` | `List[float]` | product of the coefficient and the vector<br>계수와 벡터의 곱
- please add some more hints here
Happy coding!
| Criteria 기준 |
Points 배점 |
|---|---|
| Is the code written according to Python syntax? Python 문법대로 작성되었는가? |
1 |
| Does code respect style guidelines? 코드 스타일 권고사항을 준수하는가? |
1 |
| Is the code implemented as required? 코드가 요구사항을 만족하는가? |
3 |
This template is designed for use with GitHub Classroom. Before distributing to students, configure the following in your GitHub organization or repository settings.
Each assignment requires two repositories:
- Homework template (this repo) — student-facing, contains the assignment skeleton (
exercise.py) and theclassroom.ymlworkflow that pulls the grader image and runs tests on student pushes. - Grader template (python-pytest-template) — instructor-facing, contains pytest test files and a Dockerfile. Its CI builds and publishes a grader Docker image to GHCR.
Set these in Settings > Secrets and variables > Actions > Secrets at the organization level (recommended) or per repository.
A GitHub Personal Access Token used to pull the grader Docker image from GHCR.
- Go to GitHub > Settings (user) > Developer settings > Personal access tokens > Fine-grained tokens.
- Click Generate new token.
- Set the following permissions:
| Permission | Access | Purpose |
|---|---|---|
| Packages | Read | Pull grader Docker images from GHCR |
- Copy the token and save it as a repository or organization secret named
CR_PAT.
If using GitHub Classroom, set
CR_PATas an organization secret so all student repos inherit it automatically.
The AI tutor step provides personalized feedback to students. At least one key must be set. The workflow validates this and fails early if none are configured.
| Secret Name | Service | Where to Obtain |
|---|---|---|
CLAUDE_API_KEY |
Anthropic Claude | https://console.anthropic.com/ |
GOOGLE_API_KEY |
Google Gemini | https://aistudio.google.com/ |
XAI_API_KEY |
xAI Grok | https://console.x.ai/ |
NVIDIA_NIM_API_KEY |
NVIDIA NIM | https://build.nvidia.com/ |
PERPLEXITY_API_KEY |
Perplexity | https://perplexity.ai/settings/api |
Specifies the preferred LLM model. If unset, the AI tutor defaults to Gemini or uses whichever single key is available.
Set in Settings > Secrets and variables > Actions > Variables tab.
Replace ??? with your assignment identifier (e.g., PYTHON_GRADER_301 for assignment 301). The value is the full GHCR image URL of the grader, e.g.:
ghcr.io/your-org/eca-pytest-???:latest
If this variable is not set, the workflow falls back to auto-constructing the URL as ghcr.io/{owner}/python-pytest-{assignment_num}:latest, where {assignment_num} is extracted from the repository name.
- Use this template to create a new repository (click Use this template on GitHub).
- Edit
README.md— fill in the Purpose, Description, Instructions, Example Run, and Tips sections. - Edit
exercise.py— provide starter code or an empty skeleton for students. - Update the grading criteria table if point allocations differ.
- Set
INPUT_EXPLANATION-INinclassroom.ymlto the desired feedback language (default:"English"). - Set the
CR_PATsecret, at least one LLM API key, and theECA_HW_???variable.
From here is common to all assignments.
- Modify the contents of the
exercise.pyfile to write your program.exercise.py파일의 내용을 수정하여 프로그램을 작성합니다. - Use the GitHub online editor to commit and push your changes. (See below for detailed instructions)
GitHub 온라인 편집기를 사용하여 수정 사항을 커밋하고 푸시합니다. (자세한 사용법은 아래 참조) - At the Actions tab of your Github repository, please check the result.
깃헙 저장소의 Actions 탭에서 결과를 확인 바랍니다.
- Press the . key while viewing the files in your repository on GitHub. This will launch a web version of VS Code.
저장소의 [Code] 탭을 선택 후 . 키를 누르면 MS VS Code 의 Web version 이 시작됨 - Make your changes to the
exercise.pyfile.exercise.py파일을 수정 - To commit your changes, click on the branch icon on the left sidebar (the third icon after the magnifying glass).
수정 사항을 commit 등록 하려면 왼쪽에서 줄 셋 아래 (확대경 다음) 세번째 가지치기 아이콘 선택 - Click the "+" sign next to the filename to stage your changes.
파일 이름의 오른쪽 + 기호 선택 (staging) - Write a brief description of your changes in the text box above.
위 빈칸에 변경 사항 설명 입력 - Click "Commit & Push."
[커밋 및 푸시] 선택 - Click "Back to Repository" on the branch icon to return to your repository.
줄 셋 의 [리포지토리로 이동] 선택하여 저장소로 복귀
- To help you develop a better coding habits, we encourage descriptive Git commit messages when committing changes to your repositroy.
보다 바람직한 코딩 습관을 기르기 위해, 저장소에 변경 사항을 등록할 때 메시지에 보다 자세히 설명하는 것을 권합니다. - A good commit message clearly explains what you changed and why, making it easier for you to understand your work later.
바람직한 커밋 메시지는 무엇을 변경했는지, 왜 변경했는지를 명확히 설명하여 나중에 수정 사항을 이해하기 쉽게 도와줄 것입니다.
-
Describe the change more specifically, e.g., "Add factorial function to exercise.py" or "Fix bug in sum calculation".
변경 사항을 보다 구체적으로 설명합니다. 예를 들어, "exercise.py에 팩토리얼 함수 추가" 또는 "합계 계산 버그 수정"과 같이 작성합니다. -
Use Action Verbs: Start with words like "Add", "Fix", "Update", or "Refactor".
영문의 경우, "Add", "Fix", "Update", "Refactor"와 같은 동사로 시작합니다. -
Avoid Vague Messages: Messages like "update" or "fix" can be too general.
"update", "fix"와 같은 메시지는 너무 일반적입니다. -
Keep It Concise: Aim for 15-50 characters, but ensure clarity.
15-50자 정도로 간결하게 작성하되, 명확성을 유지합니다. -
Examples 예:
- Good: "Add unit tests for sort function in exercise.py"
바람직: "exercise.py의 정렬 함수에 대한 단위 테스트 추가" - Bad: "update", "fix 1", "changed file"
바람직하지 않음: "update", "fix 1", "changed file"
- Good: "Add unit tests for sort function in exercise.py"
- Clear commit messages improve collaboration, debugging, and code review in real-world projects.
커밋 메시지가 명확하면 프로젝트 실무에서 공동 작업, 버그 수정, 코드 검토에서 도움을 얻을 수 있을 것입니다.
-
Your submissions for this assignment may be used for various educational purposes. These purposes may include developing and improving educational tools, research, creating test cases, and training datasets.
제출 결과물은 다양한 교육 목적으로 사용될 수 있을 밝혀둡니다. (교육 도구 개발 및 개선, 연구, 테스트 케이스 및 교육용 데이터셋 생성 등). -
The submissions will be anonymized and used solely for educational or research purposes. No personally identifiable information will be shared.
제출된 결과물은 익명화되어 교육 및 연구 목적으로만 사용되며, 개인 식별 정보는 공유되지 않을 것입니다. -
If you do not wish to have your submission used for any of these purposes, please inform the instructor before the assignment deadline.
위와 같은 목적으로 사용되기 원하지 않는 경우, 과제 마감일 전에 강사에게 알려주기 바랍니다.
- The template for this assigment is registered as a part of #C-2025-016393 in the Korea Copyright Commission.
Until here is common to all assignments.