Answer:
total_hours = 0
total_minutes = 0
employees = int(input("How many employees there are? "))
for e in range(employees):
hours = int(input("Enter the hours: "))
minutes = int(input("Enter the minutes: "))
total_hours += hours
total_minutes += minutes
if total_minutes >= 60:
total_hours += int(total_minutes / 60)
total_minutes = total_minutes % 60
print("Total time: " + str(total_hours) + " hours " + str(total_minutes) + " minutes")
Explanation:
Initialize the total_hours and total_minutes as 0
Ask the user to enter the number of employees
Create a for loop that iterates for each employee. Inside the loop, ask the user to enter the hours and minutes. Add the hours to total_hours (cumulative sum) and add the minutes to total_minutes (cumulative sum). If the total_minutes is greater than or equal to 60, get the number of hours in the total_minutes, divide total_minutes by 60 and get the integer part. Also, set the total_minutes to remainder of the minutes from 60
When the loop is done, print the hours and minutes as requested