Created
June 7, 2021 11:31
-
-
Save an0ndev/74cca0096262da3caa44c9859787d487 to your computer and use it in GitHub Desktop.
dumb factoring app i made for math class
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
| factor_pairs = [(1, 100), (2, 50), (4, 25), (10, 10)] | |
| min_pair = None | |
| min_perimeter = None | |
| for factor_one, factor_two in factor_pairs: | |
| perimeter = ((factor_one * 2) + (factor_two * 2)) | |
| print ("checking", (factor_one, factor_two), perimeter) | |
| if min_perimeter is None or perimeter < min_perimeter: | |
| min_pair = (factor_one, factor_two) | |
| min_perimeter = perimeter | |
| print ("found", min_pair, min_perimeter) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment