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