Skip to content

Refactor currency input and calculation logic - #146

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

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

Conversation

@harshmendhe-arch

Copy link
Copy Markdown

The logic of the program can be resolved according to this method also

The logic of the program can be resolved according to this method also
Copilot AI lite review requested due to automatic review settings September 18, 2026 16:35

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 refactor introduces a functional issue where all three prompts ask for pesos, causing soles/reais inputs to be mislabeled and likely computed incorrectly.

Get a fresh assessment by requesting another Copilot review.

Pull request overview

This PR refactors the interactive currency-input script in 2-variables/10_currency.py by changing how user prompts and variables are handled before computing the converted total.

Changes:

  • Replaced the original per-currency input variables with three generic inputs (a1, a2, a3) and separate print() prompts.
  • Updated the total calculation to use the new variables.
File summaries
File Description
2-variables/10_currency.py Refactors currency input prompts/variables and recalculates the total based on the gathered inputs.
Review details
  • Files reviewed: 1/1 changed files
  • Comments generated: 1
  • Review effort level: Lite

馃挕 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines +1 to 8
print("How much do you have left in pesos?")
a1 = int(input(": "))
print("How much do you have left in pesos?")
a2 = int(input(": "))
print("How much do you have left in pesos?")
a3 = int(input(": "))
total = a1 * 0.00025 + a2 * 0.28 + a3 * 0.21
print(total)
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