Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


could you please teach me how to program an income tax using functions



could you please teach me how to program an income tax using functions..

Answer / Manish Singh Tomar

To create a simple income tax program in Python, here's an example:

```python
def calculate_tax(income):
if income <= 4000:
return 0
elif income <= 5500:
return (income - 4000) * 0.1
elif income <= 33500:
return 1500 + (income - 5500) * 0.22
else:
return 17800 + (income - 33500) * 0.4

# Test the function
print(calculate_tax(20000))
```
This code defines a function `calculate_tax` that takes an income as its argument and returns the tax amount based on the given tax brackets. The test prints the tax for an income of £20,000.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Code Snippets Interview Questions

could you please teach me how to program an income tax using functions

1 Answers  


Categories