Skip to content

Refactor grade evaluation to use user input - #148

Open
harshmendhe-arch wants to merge 1 commit into
codedex-io:mainfrom
harshmendhe-arch:patch-3
Open

harshmendhe-arch wants to merge 1 commit into
codedex-io:mainfrom
harshmendhe-arch:patch-3

Conversation

@harshmendhe-arch

Copy link
Copy Markdown

Removed hardcoded grade and added user input for grade evaluation.

Removed hardcoded grade and added user input for grade evaluation.
Copilot AI lite review requested due to automatic review settings September 18, 2026 17:04

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

馃煛 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/num variable 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 grade variable with the ambiguous a/num alias. Every other Python exercise retains the title plus # Cod茅dex header, so please preserve that metadata and compare the input through one grade variable.
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. and You 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')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants