This PR adds a new operation to the calculator program, allowing users to calculate the exponent of a base number raised to a power. The new operation is implemented by adding a new function named exponent and modifying the calculator function to include the new operation in its menu and handle it correctly.
Summary of Changes
Added a new function named exponent that takes two arguments, base and exponent, and returns the result of base raised to the power of exponent.
Modified the calculator function to include a new print statement for the "Exponent" operation in its menu.
Added a new elif statement in the calculator function to handle the "Exponent" operation. This elif statement calls the exponent function with the user-provided numbers and prints the result in the same format as the other operations.
Please review and merge this PR. Thank you!
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, allowing users to calculate the exponent of a base number raised to a power. The new operation is implemented by adding a new function named
exponent
and modifying thecalculator
function to include the new operation in its menu and handle it correctly.Summary of Changes
exponent
that takes two arguments,base
andexponent
, and returns the result ofbase
raised to the power ofexponent
.calculator
function to include a new print statement for the "Exponent" operation in its menu.elif
statement in thecalculator
function to handle the "Exponent" operation. Thiselif
statement calls theexponent
function with the user-provided numbers and prints the result in the same format as the other operations.Please review and merge this PR. Thank you!
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: