Skip to content

Instantly share code, notes, and snippets.

@Nukesor
Last active April 27, 2017 11:30
Show Gist options
  • Save Nukesor/0eea0b7f4bd6db9f0a9002d7d3b3ff75 to your computer and use it in GitHub Desktop.
Save Nukesor/0eea0b7f4bd6db9f0a9002d7d3b3ff75 to your computer and use it in GitHub Desktop.
Einkommensteuer Berechner 2017
#!/bin/python
freibetrag = 8820
print("Steuerfreibetrag ist: {}".format(freibetrag))
hour_per_weeks = 20
weeks = 52
print("Berechnet wird für {} Std. die Woche auf {} Wochen"
.format(hour_per_weeks, weeks))
steps = 1
min_amount = 20
max_amount = 40
print("Berechnet wird in {}er Schritten zwischen {} und {} Euro die Stunde"
.format(steps, min_amount, max_amount))
current_amount = min_amount
threshold_1 = 13470
threshold_2 = 54057
threshold_3 = 256303
while current_amount <= max_amount:
brutto = hour_per_weeks * weeks * current_amount
taxable = brutto - freibetrag
if taxable > freibetrag and taxable < threshold_1:
Y = (taxable - freibetrag) / 10000
tax = (1007.27*Y + 1400)*Y
elif taxable >= threshold_1 and taxable < threshold_2:
Y = (taxable - threshold_1 - 1) / 10000
tax = (223.76 * Y + 2397) * Y + 939.57
elif taxable >= threshold_2 and taxable < threshold_3:
tax = 0.42 * taxable - 8475.44
netto = int(brutto - tax)
print("\n{} pro Stunde".format(current_amount))
print("Brutto: {}, Netto: {}".format(brutto, netto))
print("Brutto monatlich: {}, Netto monatlich: {}"
.format(int(brutto/12), int(netto/12)))
current_amount += steps
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment