Where does 'i' come from?

Viewed 27

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]))
1 Answers

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

Related