Created
March 18, 2023 01:11
-
-
Save Anequit/6f167522f7e5e8bd40ab132f43527ee8 to your computer and use it in GitHub Desktop.
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
| min_year = 1972 | |
| initial_value = 4000 | |
| def solve(t: int) -> float: | |
| try: | |
| return round(initial_value * (2 ** (t / 2)), 2) | |
| except OverflowError: | |
| print("You're looking too far into the future.") | |
| exit(1) | |
| if __name__ == "__main__": | |
| year = int(input("Year (>1972): ")) | |
| if year <= min_year: | |
| print(f"Year must be greater than {min_year}.") | |
| exit(1) | |
| transistors = ("{:,}".format(solve(year - min_year))) | |
| print(f"Transistor estimate: {transistors}") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment