python code gr7
python code gr7
Pg 67 Lab Session
1) write a python code using then string replication operator,print you name ten times.
# Type your name
name = 'Arun'
print(name * 10)
3) Write a python code input the name, age and basic salary of an employee. calculate the
total salary of an employee by adding 10% DA and 10% HRA to the basic salary.
# Input employee details
name = input("Enter the name of the employee: ")
age = input("Enter the age of the employee: ")
basic_salary = float(input("Enter the basic salary of the employee: ")
# 10% DA
da = 0.10 * basic_salary
# 10% HRA
hra = 0.10 * basic_salary
total_salary = basic_salary + da + hra
print("Employee Name: ",name)
print("Employee Age: ",age)
print(f"Basic Salary:", basic_salary)
print("Total Salary (Including 10% DA and 10% HRA):", total_salary)