Q31. Which of the following list comprehensions is equivalent to this loop? result = [] for x in range(5): result.append(x * 2)单项选择题
A
[x * 2 for x in range(5)]
B
[x for x in range(5) * 2]
C
[x * 2 in range(5)]
D
[x * 2 for range(5)]
E
[x for x * 2 in range(5)]
登录即可查看完整答案
我们收录了全球超50000道真实原题与详细解析,现在登录,立即获得答案。
类似问题
Which list comprehension below would generate the following output? [0, 1, 4, 9, 16, 25, 36, 0, 0, 0]
Question at position 21 Given a list xs, which of the following Haskell functions correctly computes a list of differences between each pair of consecutive elements? For example, given xs = [3, 8, 14, 20], the function should return [5, 6, 6]. (Note: the sign is important, the output should not be [-5, -6, -6])Clear my selection
What will the following list comprehension return?
Which of the following list should replace ??? to get [5,6,6,7] as the result?
更多留学生实用工具
希望你的学习变得更简单
加入我们,立即解锁 海量真题 与 独家解析,让复习快人一步!