Skip to content

Instantly share code, notes, and snippets.

@writer0713
Created September 3, 2025 00:39
Show Gist options
  • Select an option

  • Save writer0713/5915b3436efc196c43929060eaac307d to your computer and use it in GitHub Desktop.

Select an option

Save writer0713/5915b3436efc196c43929060eaac307d to your computer and use it in GitHub Desktop.
nomadcoders python challenge - Assignment 3
# πŸ‘‡πŸ» YOUR CODE πŸ‘‡πŸ»:
# /YOUR CODE
def get_yearly_revenue(monthly_revenue):
"""
μ›”κ°„λ§€μΆœμ„ 인자둜 λ°›μ•„μ„œ μ—°κ°„ λ§€μΆœμ„ λ¦¬ν„΄ν•˜λŠ” ν•¨μˆ˜
"""
return monthly_revenue * 12
def get_yearly_expenses(monthly_expenses):
"""
μ›”κ°„λΉ„μš©μ„ 인자둜 λ°›μ•„μ„œ μ—°κ°„ λΉ„μš©μ„ λ¦¬ν„΄ν•˜λŠ” ν•¨μˆ˜
"""
return monthly_expenses * 12
def get_tax_amount(profit):
"""
이읡을 인자둜 λ°›μ•„μ„œ, 이읡이 100,000보닀 크면 25% μ„Έμœ¨μ„ μ μš©ν•˜κ³ , 크지
μ•ŠμœΌλ©΄ 15% μ„Έμœ¨μ„ μ μš©ν•΄μ„œ μ„ΈκΈˆκΈˆμ•‘μ„ λ¦¬ν„΄ν•˜λŠ” ν•¨μˆ˜
"""
if profit > 100000:
return profit * 0.25
else:
return profit * 0.15
def apply_tax_credits(tax_amount, tax_credits):
"""
μ„ΈκΈˆκΈˆμ•‘. μ„Έμ•‘κ³΅μ œμœ¨μ„ 인자둜 λ°›μ•„μ„œ, κ³΅μ œν•  κΈˆμ•‘μ„ λ¦¬ν„΄ν•˜λŠ” ν•¨μˆ˜
"""
return tax_amount - tax_amount * tax_credits
# BLUEPRINT | DONT EDIT
monthly_revenue = 5500000
monthly_expenses = 2700000
tax_credits = 0.01
yearly_revenue = get_yearly_revenue(monthly_revenue)
yearly_expenses = get_yearly_expenses(monthly_expenses)
profit = yearly_revenue - yearly_expenses
tax_amount = get_tax_amount(profit)
final_tax_amount = tax_amount - apply_tax_credits(tax_amount, tax_credits)
print(f"Your tax bill is: ${final_tax_amount}")
# /BLUEPRINT
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment