123k views
4 votes
Write a python program that will accept monthly salary amounts greater than zero but less

than or equal to 400,000.00 until the user enters the character ‘e’. After the user

enters the character ‘e’, calculate the net pay of all salaries by deducting income tax at

a rate of 25%, pension of 5% and housing contribution of 2% from each salary

entered. Additionally, print the number of salaries that were entered in the program

along with the number of salaries that exceed 300,000.00



User Pragnesh
by
7.2k points

1 Answer

5 votes

Answer:

b=0

c=0

lol=list()

while True:

salary=input("Enter your salary: ")

if salary=="e" or salary=="E":

print("Thankyou!!")

break

else:

a=int(salary)

if a>=300000 and a<=400000:

c=c+1

if a<0 or a>400000:

print("Your salary is either too small or too big ")

if a>0 and a<=400000:

a=a-(25/100*a)-(5/100*a)-(2/100*a)

lol.append(a)

b=b+1

if a>=300000:

c=c+1

print(lol)

print("The number of salaries entered is: "+ str(b))

print("The number of salaries that exceeded 300000 is: "+str(c))

Write a python program that will accept monthly salary amounts greater than zero but-example-1
User Alexmeia
by
6.3k points