Code:
import pyfiglet
def to_color(string, color):
color_code = {'blue': '\033[34m',
'yellow': '\033[33m',
'green': '\033[32m',
'red': '\033[31m'
}
return color_code[color] + str(string) + '\033[0m'
text = pyfiglet.figlet_format(text = "__Tax Calculation__", font = 'Slant')
print(to_color(text,'green'))
name = input("Enter the employee name: ")
salary = float(input("Enter the employee salary: "))
if (salary>5000):
tax = 0.10 * salary
netsalary = salary - tax
print("The net salary of "+name+" is", salary)
else:
netsalary = salary
print("No taxable amount")
print("The net salary of"+name+" is", salary)
0 Comments