You are on page 1of 4

EX – 1

Wap to input taxable salary from user and display applicable taxes as par the slabs
attached.
TAXABLE INCOME TAX RATES
Up to rs 2.5 lakhs 5% of income above Rs. 2.5 lakh + 4% on income
tax.
Rs. 2,50,001- Rs. 5 lakhs.
Rs. 5,00,001-Rs. 10lakhs Rs. 12,500+20% of income above Rs. 5 lakh +
4%
Above Rs. 10 lakhs Rs. 1,12,500 + 30% of income above Rs 10 lakhs
+ 4%

Surce code :-
x = int(input("Enter salary: "))
y = (5/100) * x
z = (20/100) * x
f = (30/100) * x

if x <= 250000:
print("No tax")
elif 250001 <= x <= 500000:
print("Tax amount:", y + (4/100) * y)
print("Net salary:", x - (y + (4/100) * y))
elif 500001 <= x <= 1000000:
print("Tax amount:", z + (4/100) * z + 12500)
print("Net salary:", x - (z + (4/100) * z + 12500))
else:
print("Tax amount:", f + (4/100) * f + 112500)
print("Net salary:", x - (f + (4/100) * f + 112500))
OUT PUT :-
Enter salary : 350000
Tax amount : 18200.0
Net salary : 331800.0
EX :- 2

Q. Wap using function si() that recieres three arguments .


P - principle
R - Rate
T – time
If the user should have flexibility to pass any no. Of arguments and any arguments
in any order.
Use default value :-
P = 10,000
R = 7%
T = 1 year

Source code :-

def si(p=10000,r=7,t=1):
print(p*r*t/100)
si()
si(50000)
si(35000)
si(46000,t=5)
si(65000,r=8,t=4)
OUTPUT :-
700.0
3500.0
2450.0
16100.0
20800.0

You might also like