Created
January 21, 2026 21:18
-
-
Save odewahn/830074aa6637abd3ba5d2a4a8e98bb0b to your computer and use it in GitHub Desktop.
SKO code example
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 calculate_bonus(total_sales): | |
| # Intended bonus rules: | |
| # - Over $20,000 → 10% bonus | |
| # - Over $10,000 → 5% bonus | |
| # - Otherwise → 2% bonus | |
| if total_sales > 10000: | |
| return total_sales * 0.05 | |
| elif total_sales > 20000: | |
| return total_sales * 0.10 | |
| else: | |
| return total_sales * 0.02 | |
| # Example runs | |
| print("Bonus for $8,000 in sales:", calculate_bonus(8000)) | |
| print("Bonus for $15,000 in sales:", calculate_bonus(15000)) | |
| print("Bonus for $25,000 in sales:", calculate_bonus(25000)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment