This PR adds a new operation to the calculator program. The new operation is exponentiation, which raises a base number to the power of an exponent. The changes include adding a new function to perform the operation, updating the user interface to include the new operation, and modifying the main loop to handle the new operation.
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.
Updated the calculator function to include the new operation in the user interface by adding a new print statement.
Modified the main loop in the calculator function to handle the new operation by adding a new elif statement.
Updated the condition for the while loop in the calculator function to continue until the user enters '6', which is now the option to quit the calculator.
Updated the print statement that displays the goodbye message to be displayed when the user's choice is '6'.
Fixes #1.
To checkout this PR branch, run the following command in your terminal:
git checkout sweep/add-new-calculator-function
🎉 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. The new operation is exponentiation, which raises a base number to the power of an exponent. The changes include adding a new function to perform the operation, updating the user interface to include the new operation, and modifying the main loop to handle the new operation.
Summary of Changes
exponent
that takes two arguments,base
andexponent
, and returns the result ofbase
raised to the power ofexponent
.calculator
function to include the new operation in the user interface by adding a new print statement.calculator
function to handle the new operation by adding a newelif
statement.calculator
function to continue until the user enters '6', which is now the option to quit the calculator.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: