摘要:
示例,将新列表中的所有值设置为 'hello': newlist = ['hello' for x in fruits] 表达式还可以包含条件,不像筛选器那样,而是作为操纵结果的一种方式: 示例,返回 "orange" 而不是 "banana": newlist = [x if x != "bana 阅读全文
示例,将新列表中的所有值设置为 'hello': newlist = ['hello' for x in fruits] 表达式还可以包含条件,不像筛选器那样,而是作为操纵结果的一种方式: 示例,返回 "orange" 而不是 "banana": newlist = [x if x != "bana 阅读全文
posted @ 2023-10-04 21:27
小万哥丶
阅读(456)
评论(0)
推荐(1)

浙公网安备 33010602011771号