Created
September 7, 2022 21:37
-
-
Save luisgdev/681a0ae1c83ed647e63087abc83a5fc0 to your computer and use it in GitHub Desktop.
Paypal Fee Calculator
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def paypal_fee() -> None: | |
| """ | |
| Paypal Fee Calculator | |
| """ | |
| FEE_RATE: float = 0.054 | |
| TRANSACTION_CHARGE: float = 0.3 | |
| print("Let's calculate a paypal transaction fee.") | |
| amount = float(input("Amount ($): ")) | |
| fee = amount * FEE_RATE + TRANSACTION_CHARGE | |
| full_amount = (amount + TRANSACTION_CHARGE) / (1 - FEE_RATE) | |
| print( | |
| f" * Sending: $ {amount}, " | |
| f"they receive: $ {round(amount-fee, 2)}, " | |
| f"fee is: $ {round(fee, 2)}" | |
| ) | |
| print( | |
| f" * Sending: $ {round(full_amount, 2)}, " | |
| f"they receive: $ {round(amount, 2)}, " | |
| f"fee is: $ {round(full_amount-amount, 2)}" | |
| ) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment