Quick actions

cmd+k|ctrl+k

Navigation

Languages

89 - Exercise Functions

Snippet info

Language

Python

Visibility

public

Author

ciawash

Created

2024-04-12T09:39:56.274929Z

Updated

2024-04-12T10:52:22.469542Z

def highest_even(li):
    evens = []
    for item in li:
        if item % 2 == 0:
            evens.append(item)
    return max(evens)             # Be careful about the indentation. If you put the return statement inside the loop, it only return the first even number which in this case is 2

print(highest_even([2,10,2,3,4,8,11]))    
    
INFO