python-3.x “i”从何而来?[已关闭]

inkz8wg9  于 2023-04-08  发布在  Python
关注(0)|答案(1)|浏览(106)

已关闭,该问题需要details or clarity,目前不接受回答。
**想要改进此问题?**通过editing this post添加详细信息并澄清问题。

12小时前关闭。
Improve this question
从这个编码练习中,他们从哪里得到i

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]))
oxosxuxt

oxosxuxt1#

在许多编程语言中,你可以在 for 循环语句中动态定义一个变量,这就是 i 的来源。

相关问题