https://gyazo.com/eb5c5741b6a9a16c692170a41a49c858.png
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 effectiverate(r, n): # r = interest rate per year, n = times of compounding per year | |
| """The effective annual interest rate is the real return on a savings account or any interest-paying | |
| investment when the effects of compounding over time are taken into account. It also reveals the real | |
| percentage rate owed in interest on a loan, a credit card, or any other debt.""" | |
| compounded_float = 1 + (r / n) | |
| exponent_float = (compounded_float ** n ) - 1 | |
| return exponent_float |
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
| (defun my-fac (num last total) | |
| (if (> total num) | |
| nil | |
| (if (= (/ total num) 1) | |
| last | |
| (my-fac num (1+ last) (* (1+ last) total))))) | |
| (my-fac 479001600 1 1) | |
| ;; 12 |
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
| # The Fortress of Peril | |
| # A very incomplete text adventure | |
| # Adapted from some code I wrote to | |
| # better learn OOP in Python. The | |
| # parser, entities, and loop would | |
| # normally be their own modules. | |
| # Only look/examine, move, and quit | |
| # commands have been implemented. |
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
| # The Fortress of Peril | |
| # A very incomplete text adventure | |
| # Adapted from some code I wrote to | |
| # better learn OOP in Python. The | |
| # parser, entities, and loop would | |
| # normally be their own modules. | |
| # Only look/examine, move, and quit | |
| # commands have been implemented. |