-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathhighest-even-function-exercise
38 lines (35 loc) · 2.05 KB
/
highest-even-function-exercise
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#Function used to find the largest even number in a list
def highest_even(list):
large_even = -1
for num in list:
num = int(num)
if (num % 2 == 0 and num > large_even):
large_even = num
print(large_even)
highest_even([10, 1, 2, 3, 4, 8, 11, 84, 43, 29, 54, 88, 99])
/\ /\
| \ / |
| \ / \ / |
| \ /\ / \ / \ / |
| \ ^ / \/ \/ \ ^ / |
| |
/ \
/ \ / \
/ | \ / | \
/ | \ / | \
/ | @\ /@ | \
/ | \ / | \
/ \___/ \___/ \
/ \
/ |\______________________/| \
/ \ | | | | | | | /\ \
/ / \ | | | | | | | / \ \
/ / \ | | | | | | | / \ \
/ / \ \ | | | | | / / \ \
/ \ \ \_|___|___|___|___|__/ / / \
\/\/\/ /\ /\ \/\/\/
/ \ / \
| |
| \____________________/ |
\ | | /
<_________/ \_________>