0

I'm writing this program copying from the online course I'm learning, I've copied exactly the same still it is not working for me. definitely there is an error when an output is not coming. But I'm unsure as to where the error is. So i'm trying to get the output for employee of month and current_max for a tuple that is created. to figure out which person is employee of month and the time he spent.

work_hours = [('sam', 300), ('ream',200), ('deam', 400)]
def employee_check (work_hours) :
    current_max = 0
    employee_of_month = ''

    for employee, hours in work_hours:
        if hours > current_max:
            current_max = hours
            employee_of_month = employee
        else:
            pass
    return (employee_of_month, current_max)
employee_check(work_hours)
  • 2
    How are you running this, from the command line? Some environments (like Jupyter notebooks) automatically show the result of the latest statement, but by default you won't see anything unless you `print()` it. – CrazyChucky Jan 03 '23 at 00:12
  • Try `print(employee_check(work_hours))`. – John Coleman Jan 03 '23 at 00:13

0 Answers0