Refactor grade evaluation to use user input - #148
Open
harshmendhe-arch wants to merge 1 commit into
Open
harshmendhe-arch wants to merge 1 commit into
harshmendhe-arch wants to merge 1 commit into
Conversation
Removed hardcoded grade and added user input for grade evaluation.
There was a problem hiding this comment.
馃煛 Changes recommended
The moderate output-behavior change and requested header, variable-naming, and capitalization fixes remain unresolved.
Get a fresh assessment by requesting another Copilot review.
Pull request overview
This pull request refactors grade evaluation to use user input instead of a hardcoded value.
Changes:
- Adds interactive grade input and pass/fail branching.
- Preserves the passing threshold of 55.
- Changes output text and removes the standard lesson header.
- Introduces
a/numvariable aliases.
File summaries
| File | Summary and final review comments |
|---|---|
3-control-flow/12_grades.py |
Implements user-input grade evaluation. Moderate (1 vote): retain the existing You passed. and You failed. output unless the behavior change is intentional. Nits: preserve the # Grades 馃挴 / # Cod茅dex header (2 votes and 1 vote), use grade directly instead of a/num (2 votes and 1 vote), and capitalize the failure message (2 votes). |
Review details
Suppressed comments (2)
3-control-flow/12_grades.py:3
- The refactor drops the standard lesson header and replaces the descriptive
gradevariable with the ambiguousa/numalias. Every other Python exercise retains the title plus# Cod茅dexheader, so please preserve that metadata and compare the input through onegradevariable.
a = int(input("grade: "))
num = a
if num>=55:
3-control-flow/12_grades.py:6
- The PR description says this change replaces the hardcoded grade with user input, but these branches also change the existing output strings and capitalization. That changes the script's observable behavior and can break expected exercise output; retain
You passed.andYou failed.unless changing the output is intentional.
print('You passed the exam')
else:
print('you failed the exam')
- Files reviewed: 1/1 changed files
- Comments generated: 3
- Review effort level: Lite
馃挕 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
|
|
||
| if grade >= 55: | ||
| print('You passed.') | ||
| a = int(input("grade: ")) |
Comment on lines
+1
to
+3
| a = int(input("grade: ")) | ||
| num = a | ||
| if num>=55: |
| print('You passed the exam') | ||
| else: | ||
| print('You failed.') | ||
| print('you failed the exam') |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Removed hardcoded grade and added user input for grade evaluation.