Refactor currency input and calculation logic - #146
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
The logic of the program can be resolved according to this method also
There was a problem hiding this comment.
馃煛 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 separateprint()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) |
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.
The logic of the program can be resolved according to this method also