-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path07_gift_tax_calculator.py
72 lines (66 loc) · 2.19 KB
/
07_gift_tax_calculator.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
# Some say paying taxes makes Finns happy, so let's see if the secret of happiness lies in one of the taxes set out in
# Finnish tax code.
#
# According to the Finnish Tax Administration, a gift is a transfer of property to another person against no
# compensation
# or payment. If the total value of the gifts you receive from the same donor in the course of 3 years is €5,000 or
# more,
# you must pay gift tax.
#
# When the gift is received from a close relative or a family member, the amount of tax to be paid is determined by the
# following table, which is also available on this website:
# Value of gift Tax at the lower limit Tax rate for the exceeding part (%)
# 5 000 — 25 000 100 8
# 25 000 — 55 000 1 700 10
# 55 000 — 200 000 4 700 12
# 200 000 — 1 000 000 22 100 15
# 1 000 000 — 142 100 17
#
# So, for a gift of 6 000 euros the recipient pays a tax of 180 euros (100 + (6 000 - 5 000) * 0.08). Similarly, for a
# gift of 75 000 euros the recipient pays a tax of 7 100 euros (4 700 + (75 000 - 55 000) * 0.12).
#
# Please write a program which calculates the correct amount of tax for a gift from a close relative. Have a look at the
# examples below to see what is expected. Notice the lack of thousands separators in the input values - you may assume
# there will be no spaces or other thousands separators in the numbers in the input, as we haven('t yet covered dealing'
# ' with these.)
# Sample output
#
# Value of gift: 3500
# No tax!
# Sample output
#
# Value of gift: 5000
# Amount of tax: 100.0 euros
# Sample output
#
# Value of gift: 27500
# Amount of tax: 1950.0 euros
value = int(input("Value of gift: "))
if value < 25000:
low = 5000
base = 100
rate = 0.08
elif value < 55000:
low = 25000
base = 1700
rate = 0.10
elif value < 200000:
low = 55000
base = 4700
rate = 0.12
elif value < 1000000:
low = 200000
base = 22100
rate = 0.15
else:
low = 1000000
base = 142100
rate = 0.17
if value < 5000:
result = 0
else:
result = base + (value - low) * rate
if result == 0:
print("No tax!")
else:
print(f"Amount of tax: {result} euros")