fix: CR-12345 fixes#55
Conversation
|
baz review |
| # calculate the discriminant | ||
| d = (b2 ** 2) - (4 * a * c) | ||
|
|
||
| d = (b2 ** 2) - |
There was a problem hiding this comment.
d = (b2 ** 2) - is truncated and leaves a dangling -, so python/edits.py can't be parsed or imported and nothing after sol1/sol2 runs — should we fix the expression?
Finding type: Logical Bugs | Severity: 🔴 High
Want Baz to fix this for you? Activate Fixer
Other fix methods
Prompt for AI Agents
Before applying, verify this suggestion against the current code. In `python/edits.py`
around lines 17-17 where the script computes the discriminant (`d = (b2 ** 2) -`), fix
the syntax error by completing the truncated subtraction term. Restore the full
discriminant calculation used by the quadratic formula (the missing `-(4 * a * c)` part)
so the file can be imported and the subsequent `sol1` computation works. After updating
the line, quickly re-check that the variables referenced in `sol1`/`sol2` (`a`, `b2`,
`c`, and `d`) are defined consistently above in the same scope.
There was a problem hiding this comment.
To apply a code change, reply to Baz with apply commit to push the fix to this PR's branch, or apply pr to open a follow-up PR with the fix.
| kilometers = float(input("Enter value in kilometers: ok bla bla bla")) | ||
|
|
||
| # conversion factor | ||
| conv_fac = 0.621371 |
There was a problem hiding this comment.
This kilometer-to-mile conversion logic is duplicated across three scripts, should we extract a shared helper or single utility instead of copy/pasting it?
Finding type: Code Dedup and Conventions | Severity: 🟢 Low
Want Baz to fix this for you? Activate Fixer
| miles = kilometers * conv_fac | ||
| print('%0.2f kilometers is equal to %0.2f miles' % (kilometers, miles)) | ||
| print('%0.2f kilometers 0.2f miles' % (kilometers, miles)) |
There was a problem hiding this comment.
The format string is missing the second %, causing a TypeError at runtime — should we fix it to '%0.2f kilometers %0.2f miles' % (kilometers, miles)?
Finding types: Naming and Typos Logical Bugs | Severity: 🔴 High
Want Baz to fix this for you? Activate Fixer
Other fix methods
Prompt for AI Agents
In python/edits.py around lines 31-32, the print statement uses `'%0.2f kilometers 0.2f
miles' % (kilometers, miles)` — only one `%0.2f` placeholder for two values, raising a
TypeError at runtime. Update the format string to `'%0.2f kilometers %0.2f miles'` so
both `kilometers` and `miles` are formatted correctly, consistent with the pattern used
in python/additions.py and python/dir/deletions.py. Verify the output text is coherent
and no TypeError occurs on execution.
| # Program to add two matrices using nested loop | ||
|
|
||
| X = [[12, 7, 3], | ||
| [4, 5, 6], | ||
| [7, 8, 9]] | ||
|
|
||
| Y = [[5, 8, 1], | ||
| [6, 7, 3], |
There was a problem hiding this comment.
The matrix-addition example is duplicated in python/additions.py and python/dir/deletions.py, should we extract a shared helper or centralized sample?
Finding type: Code Dedup and Conventions | Severity: 🟢 Low
Want Baz to fix this for you? Activate Fixer
There was a problem hiding this comment.
To apply a code change, reply to Baz with apply commit to push the fix to this PR's branch, or apply pr to open a follow-up PR with the fix.
Generated description
Below is a concise technical summary of the changes proposed in this PR:
Update the client fetchData handler to target the corrected API endpoint and to keep related global state strings aligned with expectations. Correct the utility math script to keep its arithmetic and user I/O logic consistent and free of formatting errors.
Modified files (1)
Latest Contributors(1)
Modified files (1)
Latest Contributors(2)