Last active
February 8, 2020 01:59
-
-
Save blomer/ea48bb6cb304a9b0b6453369bc9a6f94 to your computer and use it in GitHub Desktop.
A simple calculator for determining Rocket League credit prices.
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
| # github.com/blomer | |
| def calc(c, r): | |
| value = c/100*r | |
| return value | |
| def get(): | |
| try: | |
| c = float(input('Amount of credits: ')) | |
| r = float(input('Rate (money per 100): ')) | |
| v = calc(c, r) | |
| print(f'Amount in $: {v}') | |
| i = input('Another calculation? (press enter for yes, input "n" for no.): ') | |
| if i == 'n': | |
| exit() | |
| else: | |
| get() | |
| except ValueError as e: | |
| print(f'Invalid input: {e}') | |
| get() | |
| v = calc(c, r) | |
| print(f'Amount in $: {v}') | |
| get() | |
| get() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment