题目
题目

CPT_S-355-PULLM-1-LEC Scheduled Quiz 1

单项选择题

Fill in the '???' with the correct code fragment such that Expected Result: [2, 4, 6]  

选项
A.(\x -> x `mod` 2 == 0)
B.(\x -> x `mod` 2 /= 0)
C.x `mod` 2 /= 0
D.x `mod` 2 == 0
题目图片
查看解析

查看解析

标准答案
Please login to view
思路分析
First, examine what the code is trying to do: filter a list to keep only those elements that satisfy a predicate, so the predicate must be a function that takes an element (a number in this case) and returns a Bool. Option 1: (\\x -> x `mod` 2 ==......Login to view full explanation

登录即可查看完整答案

我们收录了全球超50000道考试原题与详细解析,现在登录,立即获得答案。

类似问题

更多留学生实用工具

加入我们,立即解锁 海量真题独家解析,让复习快人一步!