首页
学习
活动
专区
工具
TVP
发布
精选内容/技术社群/优惠产品,尽在小程序
立即前往
您找到你想要的搜索结果了吗?
是的
没有找到

Day14:练习题参考答案-高阶函数和迭代器

练习1级 - 基础回顾知识点 略 - 2.1 使用 map 实现countries列表中项全部转大写,然后返回一个新的列表并打印 countries = ['Estonia', 'Finland', '...= list(map(change_upper, countries)) print(upper_countries) 2.2 使用 map 实现numbers列表中的平方计算,并返回新的列表 numbers...= filter(lambda name: 'land' not in name, countries) list_country = list(filter_countries) print("原国家数据...:", countries) print("去除含land的数据:", list_country) 2.5 使用 filter 过滤出 countries 列表中项字符串长度正好是6个的国家 countries...= filter(len_six, countries) print("长度等于6的新列表:", list(six_countries)) 2.6 使用 filter 过滤出 countries 列表中国家字符长度大于

20520
领券