Function in Python Examples

 


1. Find the Max Hr work in the list 

 >>> my_List=[('java',100),('oracle',4000),('python',300)]

>>> def emp_check(work_hours):

curr_max =0

emp_of_month =''

for emp,hr in work_hours:

if hr > curr_max:

curr_max = hr

emp_of_month = emp

else:

pass

return(emp_of_month,curr_max)

>>> emp_check(my_List)

('oracle', 4000)





Comments

Popular posts from this blog

List Examples