From this coding exercise where do they get the i from?
def highest_even(li):
evens = []
for i in li:
if i % 2 == 0:
evens.append(i)
return max(evens)
print(highest_even([10,2,3,8,11]))
From this coding exercise where do they get the i from?
def highest_even(li):
evens = []
for i in li:
if i % 2 == 0:
evens.append(i)
return max(evens)
print(highest_even([10,2,3,8,11]))
In many programming languages you are allowed to define a variable on the fly inside the for loop statement. This is where i comes from