uploaded 1-6
This commit is contained in:
19
basic programming/2nd task/3.py
Normal file
19
basic programming/2nd task/3.py
Normal file
@@ -0,0 +1,19 @@
|
||||
# Q3
|
||||
|
||||
# Get salary
|
||||
salary = float(input("Input salary: "))
|
||||
|
||||
# Calcuation of tax
|
||||
tax = 0
|
||||
|
||||
if salary > 7000:
|
||||
# If above 7000NIS, deduct 30% from the sum above 7000NIS
|
||||
tax += (salary - 7000) * 0.30
|
||||
salary = 7000 # Set salary after deducting taxed sum
|
||||
|
||||
if salary > 5000:
|
||||
# If above 5000NIS, deduct 20% from the sum above 5000NIS
|
||||
tax += (salary - 5000) * 0.20
|
||||
|
||||
# Print taxes
|
||||
print(f"Sum of taxes: {tax:.2f}NIS")
|
||||
Reference in New Issue
Block a user