This PR adds a new function for the exponent operation in the calculator program. It also updates the calculator function to include a new option for the exponent operation and adds error handling for any ValueError that may occur during the calculation.
Summary of Changes
Added a new function named 'exponent' in calculator.py that takes two arguments, a and b, and returns the result of a raised to the power of b using Python's built-in pow function.
Updated the calculator function in calculator.py to include a new option for the exponent operation. The user can now select this option and input the numbers for the exponent calculation.
Added error handling in the exponent function to catch any ValueError that may be thrown by the pow function. If an error occurs, a user-friendly error message is printed.
Updated the README.md file to include documentation for the new exponent operation.
Please review and merge this PR. Thank you!
Fixes #246.
To checkout this PR branch, run the following command in your terminal:
git checkout sweep/add-exponent-function_2
🎉 Latest improvements to Sweep:
Use Sweep Map to break large issues into smaller sub-issues, perfect for large tasks like "Sweep (map): migrate from React class components to function components"
Getting Sweep to format before committing! Check out Sweep Sandbox Configs to set it up.
We released a demo of our chunker, where you can find the corresponding blog and code.
💡 To get Sweep to edit this pull request, you can:
Leave a comment below to get Sweep to edit the entire PR
Leave a comment in the code will only modify the file
Edit the original issue to get Sweep to recreate the PR from scratch
Description
This PR adds a new function for the exponent operation in the calculator program. It also updates the calculator function to include a new option for the exponent operation and adds error handling for any ValueError that may occur during the calculation.
Summary of Changes
Please review and merge this PR. Thank you!
Fixes #246.
To checkout this PR branch, run the following command in your terminal:
🎉 Latest improvements to Sweep:
💡 To get Sweep to edit this pull request, you can: