Created
March 12, 2023 05:54
-
-
Save balapriyac/7b6771ec773d22258dc92056a95693eb to your computer and use it in GitHub Desktop.
This file contains 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
max_discount = 50 | |
discount = 20 | |
assert discount <= max_discount | |
def get_final_score(score,bonus,max_score): | |
if bonus: | |
score += 10 | |
if score > max_score: | |
return max_score | |
return score | |
final_score = get_final_score(<some-score>,<bonus>,<max_score>) | |
assert final_score <= max_score,f"final_score should be at most {max_score}; got {final_score}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment