Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #intialize total_hours to 0
- total_hours = 0
- #use for loop to enter works hours for 10 workers
- for i in range(10):
- worker_hours = float(input("Enter hours for worker:"))
- # add the worker_hours to the total_hours
- total_hours = total_hours + worker_hours
- # calculate the average worker hours
- average_hours = total_hours / 10
- # output the total hours and the average hours
- print("Total Worker Hours: ", total_hours)
- print("Average hours:", average_hours)
Advertisement
Add Comment
Please, Sign In to add comment