Python 阶段编程练习(二十)
编程练习
使用filter函数,求0-50以内(包括50)的偶数
[0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 42, 44,46, 48, 50]
任务
定义use_filter函数
函数体内:实现过滤偶数值的功能
任务提示
使用变量data接收0-50(包含50)的数字,即list(range(51))
原始代码
def use_filter(data):
#...
hn.icodeq.com1 min read