This PR adds a new operation to the calculator program that calculates the exponent of a number. It includes the following changes:
Added a new function named 'exponent' to calculate the exponent of a number.
Modified the 'calculator' function to include the new 'exponent' operation.
Handled the case where the base is zero and the exponent is negative by raising a ValueError.
Added a new print statement to display the option for the 'Exponent' operation.
Added a new elif statement to handle the 'Exponent' operation in the 'calculator' function.
Handled the ValueError that could be raised by the 'exponent' function.
Summary of Changes
Added a new function 'exponent' to calculate the exponent of a number.
Modified the 'calculator' function to include the 'Exponent' operation.
Handled the case where the base is zero and the exponent is negative.
Added a new print statement to display the 'Exponent' operation option.
Handled the ValueError that could be raised by the 'exponent' function.
Fixes #1.
To checkout this PR branch, run the following command in your terminal:
git checkout sweep/add-exponent-operation_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 operation to the calculator program that calculates the exponent of a number. It includes the following changes:
Summary of Changes
Fixes #1.
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: