#try to avoid input function
a = input("Enter your name :")
b = int(input("Enter your work experience in years :"))
c = input("Enter your gender(male or female) :")
d = int(input("Enter your basic salary :"))
if c == "female":
if 0 <= b <= 20:
e,f = (15/100)*d,(10/100)*d
elif 21 <= b <= 30:
e,f = (30/100)*d,(15/100)*d
elif b > 30:
e,f = (40/100)*d,(25/100)*d
else:
print("Invalid input")
elif c == "male":
if 0 <= b <= 20:
e,f = (15/100)*d,(10/100)*d
elif 21 <= b <= 30:
e,f = (25/100)*d,(10/100)*d
elif b > 30:
e,f = (35/100)*d,(2/100)*d
else:
print("Invalid input")
else:
print("Invalid Input.")
print("Basic salary : "+str(d)+", DA : "+str(e)+", HDA : "+str(f)+", Total salary : "+str(d+e+f))
Click the run button. Try to avoid input() function.