Python Code: Keep the Code and Employees.txt in same folder
def GrossPay(hrs):
return hrs*15.25
print("%-30s%s"%("Name", "Pay"))
with open("Employees.txt", 'r') as f:
for line in f:
Name, hrs = line.split(',')
hrs = int(hrs)
print("%-30s$%.2f"%(Name, GrossPay(hrs)))
OUTPUT:
Employees.txt John Doe,40 Sally Buck, 45 2) Write some Python codes that processes a file of...
(Python) Write a program called sales.py that uses a list to hold the sums of the sales for each month. The list will have 12 items with index 0 corresponds with month of “Jan”, index 1 with month “Feb”, etc. o Write a function called Convert() which is passed a string which is a month name (ex. “Jan”) and returns the matching index (ex. 0). Hint – use a list of strings to hold the months in the correct order,...
Python 3 Question Please keep the code introductory friendly and include comments. Many thanks. Prompt: The owners of the Annan Supermarket would like to have a program that computes the weekly gross pay of their employees. The user will enter an employee’s first name, last name, the hourly rate of pay, and the number of hours worked for the week. In addition, Annan Supermarkets would like the program to compute the employee’s net pay and overtime pay. Overtime hours, any...